X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=buildd%2Ffunctions.sh;h=b8652ff81b0eb7d91e27b95e47baa2ec1ee7d09b;hp=7b979bc81f5536103ba7d93ccf4d272b70618cfb;hb=0c7b720f211338bc15e7d32828e1bc864c64bd0c;hpb=0a08c07e12394fabaf1b92b9c10f0632d88de1c3 diff --git a/buildd/functions.sh b/buildd/functions.sh index 7b979bc..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() { @@ -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=$? @@ -75,6 +75,14 @@ create_logs() { ( 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: iso_details() { if ! [ -f "$OUTPUT_DIR/grml_isos/$ISO_NAME" ] ; then @@ -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): @@ -110,17 +123,18 @@ 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 }