X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcommon;fp=config%2Fdebian%2Fcommon;h=21e0d48350c4b36179717cd61fa21783b68a4b82;hb=c7c3004d7fb00f8d419178ea982d30ab2c61b681;hp=6c3a5ba0209e6863f1654052ada2af45c6147c7b;hpb=5208abd2595e1f188a4a2a7937ce6e1e37e75a23;p=dak.git diff --git a/config/debian/common b/config/debian/common old mode 100644 new mode 100755 index 6c3a5ba0..21e0d483 --- 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} ${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}] 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 } @@ -102,7 +102,7 @@ function make_buildd_dir () { dak generate-releases -a build-queues >/dev/null # Stick a last modified date in the page footer - echo "

Last updated: `date -u`

" > ${incoming}/web/README.html + echo "

Last updated: $(date -u)

" > ${incoming}/web/README.html # Tell the mirrors that we've updated log "Pushing static for incoming.d.o" @@ -165,9 +165,11 @@ function do_unchecked () { if [[ ! -z ${changes} ]]; then log "Processing files ${changes}" - echo "${timestamp}: ${changes}" >> ${report} - dak process-upload -a -d "$unchecked" >> ${report} - dak process-commands -d "$unchecked" >> ${report} + { + echo "${timestamp}: ${changes}" + dak process-upload -a -d "$unchecked" + dak process-commands -d "$unchecked" + } >> ${report} sync_debbugs do_buildd @@ -223,7 +225,7 @@ function reports() { log "Sending information about crufty packages" dak cruft-report -R > $webdir/cruft-report-daily.txt dak cruft-report -R -s experimental >> $webdir/cruft-report-daily.txt - cat $webdir/cruft-report-daily.txt | mail -a "X-Debian: DAK" -e -s "Debian archive cruft report for $(date +%D)" -a "From: Debian FTP Masters " ftpmaster@ftp-master.debian.org + mail -a "X-Debian: DAK" -e -s "Debian archive cruft report for $(date +%D)" -a "From: Debian FTP Masters " ftpmaster@ftp-master.debian.org < $webdir/cruft-report-daily.txt } function pg_timestamp() { @@ -306,7 +308,7 @@ function stage() { if [[ -f ${STAGEFILE} ]]; then local stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}") local unixtime=$(date +%s) - local difference=$(( $unixtime - $stamptime )) + local difference=$(( unixtime - stamptime )) if [[ ${difference} -ge 14400 ]]; then log_error "Did already run ${FUNC}, stagefile exists, but that was ${difference} seconds ago. Please check." else