# 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
function log_error () {
log "$@"
if [[ -z ${MAILTO} ]]; then
- echo "$@" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@${HOSTNAME}] ERROR [$$]" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ${MAILTO}
+ echo "$*" | mail -a "X-Debian: DAK" -e -s "[$PROGRAM@${HOSTNAME}] ERROR [$$]" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" ${MAILTO}
fi
}
dak generate-releases -a build-queues >/dev/null
# Stick a last modified date in the page footer
- echo "<p>Last updated: `date -u`</p>" > ${incoming}/web/README.html
+ echo "<p>Last updated: $(date -u)</p>" > ${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
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
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>" 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>" ftpmaster@ftp-master.debian.org < $webdir/cruft-report-daily.txt
}
function pg_timestamp() {
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