]> git.decadent.org.uk Git - dak.git/commitdiff
make onerror() in dinstall.functions more robust
authorTorsten Werner <twerner@debian.org>
Sat, 1 Jan 2011 16:44:29 +0000 (17:44 +0100)
committerTorsten Werner <twerner@debian.org>
Sat, 1 Jan 2011 16:44:29 +0000 (17:44 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
config/debian/dinstall.functions

index 0ad674ea1d39a5cbe2a8a8a8fbbcc888ebebb154..98972e6df0559f845dd4d1d5ffb211040b44965f 100644 (file)
@@ -22,7 +22,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
 }
 
 ########################################################################