X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcommon;fp=config%2Fdebian%2Fcommon;h=0754159ea93b41e7fbd0cd50dce0627def7d429c;hb=813801add25896afc4bd9839f5d1fe0c05eea465;hp=bc3248c7470dd6cad1b5f8f44398d5bfcffccc6d;hpb=b2d06df451fcf23b97f572a4253ccfbd26d58f45;p=dak.git diff --git a/config/debian/common b/config/debian/common index bc3248c7..0754159e 100644 --- a/config/debian/common +++ b/config/debian/common @@ -4,7 +4,7 @@ # Set $PROGRAM to a string to have it added to the output. function log () { local prefix=${PROGRAM:-} - echo "$(date +"%b %d %H:%M:%S") $(hostname -s) ${prefix}[$$]: $@" + echo "$(date +"%b %d %H:%M:%S") ${HOSTNAME} ${prefix}[$$]: $@" } # log the message using log() but then also send a mail @@ -12,7 +12,7 @@ function log () { function log_error () { log "$@" if [ -z "${MAILTO}" ]; then - echo "$@" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@$(hostname -s)] ERROR [$$]" -a "From: Debian FTP Masters " ${MAILTO} + echo "$@" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@${HOSTNAME}] ERROR [$$]" -a "From: Debian FTP Masters " ${MAILTO} fi } @@ -347,7 +347,7 @@ function stage() { # Now we should make sure that we have a usable ${PROGRAM}.log, so # append the $STAGEFILE.log to it. - cat "${STAGEFILE}.log" >> "${LOGFILE}" + /usr/bin/ts "%b %d %H:%M:%S ${HOSTNAME} ${PROGRAM}[$$]: ${FUNC} " < "${STAGEFILE}.log" rm -f "${STAGEFILE}.log" log "########## ${PROGRAM} END: ${FUNC} ##########"