X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=buildd%2Ffunctions.sh;h=6ea37cdbf2e04c70d1754fbb4997ba3dd649f7e6;hb=00982709e1675875e39657464380cf4ad7e60411;hp=8bdbd1a3dadf81be3a3163f50a6cd9723fcc9d59;hpb=602a9012c17ebff9efede09b7f8754d7a583faec;p=grml-live.git diff --git a/buildd/functions.sh b/buildd/functions.sh index 8bdbd1a..6ea37cd 100755 --- a/buildd/functions.sh +++ b/buildd/functions.sh @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2 or any later version. -# Latest change: Die Okt 30 09:47:34 CET 2007 [mika] +# Latest change: Sun Dec 09 18:38:26 CET 2007 [mika] ################################################################################ die() { @@ -45,7 +45,7 @@ else [ -n "$GRML_LOGFILE" ] || GRML_LOGFILE=/var/log/grml-live.log fi -[ -n "$FAI_LOGFILES" ] || FAI_LOGFILES=/var/log/fai/dirinstall/grml +[ -n "$FAI_LOGFILES" ] || FAI_LOGFILES=/var/log/fai/grml/last echo "my_hdr From: grml-live autobuild daemon <$FROM>" > $MUTT_HEADERS @@ -72,7 +72,15 @@ grml_live_run() { # create log archive: create_logs() { - ( cd / && tar zcf $ATTACHMENT var/log/fai/dirinstall/grml $GRML_LOGFILE 1>/dev/null ) + ( cd / && tar zcf $ATTACHMENT $FAI_LOGFILES $GRML_LOGFILE 1>/dev/null ) +} + +# store logs on remote server: +upload_logs() { + [ -n "$RSYNC_MIRROR" ] || return 1 +# eval $(grep '^LOGDIR=' $FAI_LOGFILES/variables.log) + rsync --exclude dmesg.log --times --partial -az --quiet /var/log/grml-buildd.* \ + $FAI_LOGFILES $GRML_LOGFILE $RSYNC_MIRROR/logs/"${NAME}_${DATE}"/ } # store information of ISO size: @@ -86,12 +94,17 @@ iso_details() { # send status mail: send_mail() { + # attach logs only if we have some: + [ -r "$ATTACHMENT" ] && MUTT_ATTACH="-a $ATTACHMENT" || MUTT_ATTACH='' + echo -en "Automatically generated mail by $SCRIPTNAME $ISO_DETAILS Return code of grml-live run was: $RC +$(grep 'Executed command line:' $GRML_LOGFILE || echo "* executed command line not available") + The following errors have been noticed (several might be warnings only): $(grep -i error $FAI_LOGFILES/* /var/log/grml-buildd.std* | grep -ve liberror -ve libgpg-error || echo "* nothing") @@ -100,10 +113,16 @@ The following warnings have been noticed: $(grep -i warn $FAI_LOGFILES/* /var/log/grml-buildd.std* || echo "* nothing") -Find details in the attached logs." | \ - mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" \ - -a $ATTACHMENT \ - $RECIPIENT +There following dependency problems have been noticed: + +$(grep -i "Not Installed" $FAI_LOGFILES/software.log || echo "* nothing") + +The following packages could not be installed: + +$(grep -i "Couldn't find.*package" $FAI_LOGFILES/software.log | sed 's/\(.*\)"\(.*\)"\(.*\)/\2/' | sort -u || echo "* nothing") + +EOF " | \ + mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" $MUTT_ATTACH "$RECIPIENT" } # make sure we store the final iso: