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

[dak/master] Make timestamping configurable and only let dinstall have it for now



---
 config/debian/common             | 6 +++++-
 config/debian/dinstall.variables | 3 +++
 config/debian/vars               | 3 +++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/config/debian/common b/config/debian/common
index 0754159..0177f1f 100644
--- a/config/debian/common
+++ b/config/debian/common
@@ -347,7 +347,11 @@ function stage() {
 
     # Now we should make sure that we have a usable ${PROGRAM}.log, so
     # append the $STAGEFILE.log to it.
-    /usr/bin/ts "%b %d %H:%M:%S ${HOSTNAME} ${PROGRAM}[$$]: ${FUNC} " < "${STAGEFILE}.log"
+    if [[ ${TIMESTAMP} == true ]]; then
+        /usr/bin/ts "%b %d %H:%M:%S ${HOSTNAME} ${PROGRAM}[$$]: ${FUNC} " < "${STAGEFILE}.log"
+    else
+        cat "${STAGEFILE}.log"
+    fi
     rm -f "${STAGEFILE}.log"
 
     log "########## ${PROGRAM} END: ${FUNC} ##########"
diff --git a/config/debian/dinstall.variables b/config/debian/dinstall.variables
index 2587b2a..000697f 100644
--- a/config/debian/dinstall.variables
+++ b/config/debian/dinstall.variables
@@ -55,3 +55,6 @@ done
 
 # Common wget options
 wgetopts="-t2 -T20 -q -N --ca-directory=/etc/ssl/ca-debian"
+
+# dinstall wants timestamps added to stage logs
+TIMESTAMP=true
diff --git a/config/debian/vars b/config/debian/vars
index d134d9c..3a7483c 100644
--- a/config/debian/vars
+++ b/config/debian/vars
@@ -44,6 +44,9 @@ LOCK_DAILY="${lockdir}/daily.lock"
 LOCK_UNCHECKED="${lockdir}/unchecked.lock"
 LOCK_STOP="${lockdir}/archive.stop"
 
+# By default, add no timestamps to stage logs
+TIMESTAMP=false
+
 # And the following types of cronscripts exists
 declare -lr POSSIBLEARGS='+(unchecked|dinstall|hourly|daily|weekly|monthly|yearly)'
 declare -r HOSTNAME=$(hostname -s)
-- 
2.1.4


Reply to: