X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcommon;h=62ec9a1ed8f47d08dd3959b9f56a50b0fb482359;hb=be8648509d039e6737fa601c61884747c6ee094e;hp=6c3a5ba0209e6863f1654052ada2af45c6147c7b;hpb=c6c8341a1a5643dc43c1785936068b6432aaaf12;p=dak.git diff --git a/config/debian/common b/config/debian/common old mode 100644 new mode 100755 index 6c3a5ba0..62ec9a1e --- 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,11 +102,11 @@ 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" - chronic /usr/local/bin/static-update-component incoming.debian.org + chronic /usr/local/bin/static-update-component incoming.debian.org < /dev/null } # Process (oldstable)-proposed-updates "NEW" queue @@ -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 @@ -221,9 +223,11 @@ function reports() { dak queue-report -d backports-new,backports-policy | mail -a "X-Debian: DAK" -e -s "NEW and POLICY on $(date +%D)" -a "From: Debian FTP Masters " backports-team@debian.org # and one on crufty packages 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 + dak cruft-report -R > $webdir/cruft-report-daily.txt.new + dak cruft-report -R -s experimental >> $webdir/cruft-report-daily.txt.new + echo "Page generated on $(date -u)" >> $webdir/cruft-report-daily.txt.new + mv $webdir/cruft-report-daily.txt.new $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 < $webdir/cruft-report-daily.txt } function pg_timestamp() { @@ -306,7 +310,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