X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=buildd%2Ffunctions.sh;h=b8652ff81b0eb7d91e27b95e47baa2ec1ee7d09b;hp=c6f91fa39071c7d4d1b968af704d9818d304d4b8;hb=0c7b720f211338bc15e7d32828e1bc864c64bd0c;hpb=c5624ba39fa032cda30698121bb8775640edb965 diff --git a/buildd/functions.sh b/buildd/functions.sh index c6f91fa..b8652ff 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 @@ -58,7 +58,7 @@ grml_live_run() { fi fi - grml-live -F $GRML_LIVE_ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \ + grml-live -F $* $GRML_LIVE_ARCH -s $SUITE -c $CLASSES -o $OUTPUT_DIR \ -g $NAME -v $DATE -r grml-live-autobuild -i $ISO_NAME \ 1>/var/log/grml-buildd.stdout \ 2>/var/log/grml-buildd.stderr ; RC=$? @@ -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 + umask 002 + rsync --exclude dmesg.log --times --partial --copy-links -az --quiet /var/log/grml-buildd.* \ + $FAI_LOGFILES $GRML_LOGFILE $RSYNC_MIRROR/logs/"${NAME}_${DATE}"/ } # store information of ISO size: @@ -86,13 +94,18 @@ 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") +$(grep -A2 'Executed grml-live' $GRML_LOGFILE || echo "* executed grml-live command line not available") + +$(grep -A2 'Executed FAI' $GRML_LOGFILE || echo "* executed FAI command line not available") The following errors have been noticed (several might be warnings only): @@ -102,21 +115,26 @@ The following warnings have been noticed: $(grep -i warn $FAI_LOGFILES/* /var/log/grml-buildd.std* || echo "* nothing") +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") -Find details in the attached logs." | \ - mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" \ - -a $ATTACHMENT \ - $RECIPIENT +EOF " | \ + mutt -s "$SCRIPTNAME [${DATE}] - $RC_INFO" $MUTT_ATTACH "$RECIPIENT" } # make sure we store the final iso: store_iso() { if [ "$RC" = "0" ] ; then [ -d "$ISO_DIR" ] || mkdir "$ISO_DIR" - mv $OUTPUT_DIR/grml_isos/$ISO_NAME $ISO_DIR + mv "${OUTPUT_DIR}/grml_isos/${ISO_NAME}" "$ISO_DIR" + if [ -r "${OUTPUT_DIR}/grml_isos/${ISO_NAME}.md5" ] ; then + mv "${OUTPUT_DIR}/grml_isos/${ISO_NAME}.md5" "${ISO_DIR}" + fi fi }