# 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"
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
# import the general variable set. (This will overwrite configdir, but
# it is expected to have the same value)
export SCRIPTVARS=${configdir}/vars
-. $SCRIPTVARS
+. ${SCRIPTVARS}
# One arg please
declare -lr ARG=${1:-"meh"}
${POSSIBLEARGS})
# Only one of me should ever run.
FLOCKER=${FLOCKER:-""}
- [ "${FLOCKER}" != "${configdir}/${PROGRAM}.tasks" ] && exec env FLOCKER="${configdir}/${PROGRAM}.tasks" flock -E 0 -en "${configdir}/${PROGRAM}.tasks" "$0" "$@" || :
+ [[ ${FLOCKER} != ${configdir}/${PROGRAM}.tasks ]] && exec env FLOCKER="${configdir}/${PROGRAM}.tasks" flock -E 0 -en "${configdir}/${PROGRAM}.tasks" "$0" "$@" || :
;;
*)
cat - <<EOF
# Now check if we still know about the packages for which they created the files
# is the timestamp signed by us?
- if $(gpgv --keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/pubring.gpg timestamp.gpg timestamp); then
+ if gpgv --keyring /srv/ftp-master.debian.org/s3kr1t/dot-gnupg/pubring.gpg timestamp.gpg timestamp; then
# now read it. As its signed by us we are sure the content is what we expect, no need
# to do more here. And we only test -d a directory on it anyway.
TSTAMP=$(cat timestamp)
for comp in main contrib non-free; do
mkdir -p ${ftpdir}/dists/${dir}/${comp}/dep11
cd ${dir}/${comp}
- rsync -aq --delete --delete-after --exclude *.tmp . ${ftpdir}/dists/${dir}/${comp}/dep11/.
+ rsync -aq --delete --delete-after --exclude ./*.tmp . ${ftpdir}/dists/${dir}/${comp}/dep11/.
cd ${dep11dir}
done
fi
fi
RFC822DATE=$(LC_ALL=POSIX LANG=POSIX date -u -R)
date -u > ${TRACEFILE}
- echo "Using dak v1" >> ${TRACEFILE}
- echo "Running on host: $(hostname -f)" >> ${TRACEFILE}
- echo "Archive serial: ${SERIAL}" >> ${TRACEFILE}
- echo "Date: ${RFC822DATE}" >> ${TRACEFILE}
+ {
+ echo "Using dak v1"
+ echo "Running on host: $(hostname -f)"
+ echo "Archive serial: ${SERIAL}"
+ echo "Date: ${RFC822DATE}"
+ } >> ${TRACEFILE}
# Now make it accessible via one name, no matter on which host we run
cd ${archiveroot}/project/trace/
ln -sf ftp-master.debian.org master
}
function maillogfile() {
- cat "$LOGFILE" | mail -a "X-Debian: DAK" -s "Log for dinstall run of ${NOW}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" cron@ftp-master.debian.org
+ mail -a "X-Debian: DAK" -s "Log for dinstall run of ${NOW}" -a "From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>" cron@ftp-master.debian.org < "${LOGFILE}"
}
function testingsourcelist() {