]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/cron.dinstall
dak.conf
[dak.git] / config / debian / cron.dinstall
index 82f7cbeb5510f3e6fc25fe9da9350d01e091d209..a7d901af09e47b4030c6ca79a7613bc4407be508 100755 (executable)
@@ -58,7 +58,16 @@ function cleanup() {
 # If we error out this one is called, *FOLLOWED* by cleanup above
 function onerror() {
     ERRDATE=$(date "+%Y.%m.%d-%H:%M:%S")
-    cat "${STAGEFILE}.log" | mail -s "ATTENTION ATTENTION! dinstall error at ${ERRDATE} in ${STAGEFILE} - (Be quiet, Brain, or I'll stab you with a Q-tip)" cron@ftp-master.debian.org
+
+    subject="ATTENTION ATTENTION!"
+    if [ "${error}" = "false" ]; then
+        subject="${subject} (continued)"
+    else
+        subject="${subject} (interrupted)"
+    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
 }
 
 ########################################################################
@@ -447,6 +456,8 @@ function stage() {
     ARGS='GO[@]'
     local "${!ARGS}"
 
+    error=${ERR:-"false"}
+
     STAGEFILE="${stagedir}/${FUNC}"
     if [ -f "${STAGEFILE}" ]; then
         stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}")
@@ -476,7 +487,7 @@ function stage() {
         exit 42
     fi
 
-    if [ "${ERR}" = "false" ]; then
+    if [ "${error}" = "false" ]; then
         set +e
     fi
     ${FUNC} ${ARGS}