X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=buildd%2Ffunctions.sh;h=6ea37cdbf2e04c70d1754fbb4997ba3dd649f7e6;hb=67304be75bd8ee0e517ea3f8e409c06fa7a00c26;hp=967c8f1170e5153557119a9235a59e87bca57441;hpb=06671c3424c60d65e9006d80cdf67d519b75d5ba;p=grml-live.git diff --git a/buildd/functions.sh b/buildd/functions.sh index 967c8f1..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,6 +94,9 @@ 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 @@ -110,10 +121,8 @@ 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: