From bba165ccfeb6a260bba035a16ba4f0e78392fa81 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Sat, 2 Jan 2016 14:38:26 +0100 Subject: [PATCH] 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 0754159e..0177f1f6 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 2587b2a8..000697fa 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 d134d9c4..3a7483cb 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.39.2