X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fdinstall.functions;h=605dd2b907cd6b8376d58fd2effea2ddf36b1b00;hb=3d8fa539bcd54aa937d68dd29ff6d12e04588e25;hp=0ad674ea1d39a5cbe2a8a8a8fbbcc888ebebb154;hpb=64f709a508e27db13034026b86f0c794b0574da3;p=dak.git diff --git a/config/debian/dinstall.functions b/config/debian/dinstall.functions index 0ad674ea..605dd2b9 100644 --- a/config/debian/dinstall.functions +++ b/config/debian/dinstall.functions @@ -4,10 +4,14 @@ function ts() { echo "Archive maintenance timestamp ($1): $(date +%H:%M:%S)" } -# Cleanup actions +# Remove all locks +function remove_locks() { + rm -f $LOCK_DAILY $LOCK_ACCEPTED $LOCK_NEW +} + +# trap handler for cleaning up on signal / error function cleanup() { - rm -f ${LOCK_DAILY} - rm -f ${LOCK_ACCEPTED} + remove_locks } # If we error out this one is called, *FOLLOWED* by cleanup above @@ -22,7 +26,11 @@ function onerror() { fi subject="${subject} dinstall error at ${ERRDATE} in ${STAGEFILE} - (Be quiet, Brain, or I'll stab you with a Q-tip)" - cat "${STAGEFILE}.log" | mail -s "${subject}" -a "X-Debian: DAK" cron@ftp-master.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org + if [ -r "${STAGEFILE}.log" ]; then + cat "${STAGEFILE}.log" + else + echo "file ${STAGEFILE}.log does not exist, sorry" + fi | mail -s "${subject}" -a "X-Debian: DAK" cron@ftp-master.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org } ########################################################################