[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] Remove an indirection



---
 config/debian/cron.dinstall      | 20 ++++++++++++--------
 config/debian/dinstall.functions | 16 ----------------
 2 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall
index 068ac62..da0f78d 100755
--- a/config/debian/cron.dinstall
+++ b/config/debian/cron.dinstall
@@ -279,15 +279,19 @@ log "Daily cron scripts successful, all done"
 
 exec > "$logdir/afterdinstall.log" 2>&1
 
-GO=(
-    FUNC="renamelogfile"
-    TIME=""
-    ARGS=""
-    ERR="false"
-)
-stage $GO
-state "all done"
+if [ -f "${dbdir}/dinstallstart" ]; then
+    NOW=$(cat "${dbdir}/dinstallstart")
+    mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
+    logstats "$logdir/dinstall_${NOW}.log"
+    bzip2 -9 "$logdir/dinstall_${NOW}.log"
+else
+    error "Problem, I don't know when dinstall started, unable to do log statistics."
+    NOW=`date "+%Y.%m.%d-%H:%M:%S"`
+    mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
+    bzip2 -9 "$logdir/dinstall_${NOW}.log"
+fi
 
+state "all done"
 
 # Now, at the very (successful) end of dinstall, make sure we remove
 # our stage files, so the next dinstall run will do it all again.
diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions
index 4440f51..6506385 100644
--- a/config/debian/dinstall.functions
+++ b/config/debian/dinstall.functions
@@ -622,22 +622,6 @@ function maillogfile() {
     cat "$LOGFILE" | mail -a "X-Debian: DAK" -s "Log for dinstall run of ${NOW}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" cron@ftp-master.debian.org
 }
 
-function renamelogfile() {
-    if [ -f "${dbdir}/dinstallstart" ]; then
-        NOW=$(cat "${dbdir}/dinstallstart")
-#        maillogfile
-        mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
-        logstats "$logdir/dinstall_${NOW}.log"
-        bzip2 -9 "$logdir/dinstall_${NOW}.log"
-    else
-        error "Problem, I don't know when dinstall started, unable to do log statistics."
-        NOW=`date "+%Y.%m.%d-%H:%M:%S"`
-#        maillogfile
-        mv "$LOGFILE" "$logdir/dinstall_${NOW}.log"
-        bzip2 -9 "$logdir/dinstall_${NOW}.log"
-    fi
-}
-
 function testingsourcelist() {
     dak ls -s testing -f heidi -r .| egrep 'source$' > ${webdir}/testing.list
 }
-- 
2.1.4



Reply to: