# 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
}
########################################################################
ARGS='GO[@]'
local "${!ARGS}"
+ error=${ERR:-"false"}
+
STAGEFILE="${stagedir}/${FUNC}"
if [ -f "${STAGEFILE}" ]; then
stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}")
exit 42
fi
- if [ "${ERR}" = "false" ]; then
+ if [ "${error}" = "false" ]; then
set +e
fi
${FUNC} ${ARGS}