From d62c2997831061be91baeef98942b188340d517e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Thu, 11 Sep 2014 08:57:36 +0000 Subject: do not use 'ls' for iterating over files as this gives us an error if there are no logfiles at all. furthermore using the output of 'ls' is considered insecure anyhow (w.g. it breaks if a filename contained LF) svn path=/trunk/; revision=17351 --- scripts/auto-build/mail-mingw-log-hack.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scripts/auto-build') diff --git a/scripts/auto-build/mail-mingw-log-hack.sh b/scripts/auto-build/mail-mingw-log-hack.sh index 0819bc05..57c19764 100755 --- a/scripts/auto-build/mail-mingw-log-hack.sh +++ b/scripts/auto-build/mail-mingw-log-hack.sh @@ -17,7 +17,8 @@ mailbody_on_failure () { } -for logfile in $(ls -1 /home/apt/www/auto-build/${DATE}/logs/${DATE}_*_mingw*.txt); do +for logfile in /home/apt/www/auto-build/${DATE}/logs/${DATE}_*_mingw*.txt; do + if [ -r "${logfile}" ]; then completion_test=$(tail -1 "${logfile}") if [ "x${completion_test}" != "xSUCCESS" ]; then if [ "x${RECIPIENT}" != "x" ]; then @@ -25,4 +26,5 @@ for logfile in $(ls -1 /home/apt/www/auto-build/${DATE}/logs/${DATE}_*_mingw*.tx mailbody_on_failure "${logfile}" | mail -s "autobuild: $logfile" ${RECIPIENT} fi fi + fi done -- cgit v1.2.1