From 42c15c9e98e348be9c6f355a3b52373db981b52c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 12 Dec 2009 16:55:45 +0100 Subject: [PATCH] Move package validator behind FAI --- etc/grml/grml-live.conf | 2 +- grml-live | 36 +++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/etc/grml/grml-live.conf b/etc/grml/grml-live.conf index 096ece9..6a4671b 100644 --- a/etc/grml/grml-live.conf +++ b/etc/grml/grml-live.conf @@ -171,7 +171,7 @@ # URL for downloading the windows files: # WINDOWS_BINARIES="http://the.earth.li/~sgtatham/putty/latest/x86/" -# Do you want exit grml-live if some packages were requested for installation +# Do you want to exit grml-live if some packages were requested for installation # on fresh installs but are missing on the generated ISO finally? # By default the package list is sent to stdout but grml-live doesn't interrupt. # EXIT_ON_MISSING_PACKAGES=1 diff --git a/grml-live b/grml-live index 207f982..aaaf48f 100755 --- a/grml-live +++ b/grml-live @@ -572,6 +572,25 @@ else fi # BUILD_DIRTY? # }}} +# package validator {{{ +CHECKLOG=/var/log/fai/$HOSTNAME/last +# package validator +if [ -r "$CHECKLOG/package_errors.log" ] && grep -q '[a-z]' "$CHECKLOG/package_errors.log" ; then + + if [ -n "$EXIT_ON_MISSING_PACKAGES" ] ; then + eerror "The following packages were requested for installation but could not be processed:" + cat $CHECKLOG/package_errors.log + eerror "... exiting as requested via \$EXIT_ON_MISSING_PACKAGES." + eend 1 + bailout 13 + else + ewarn "The following packages were requested for installation but could not be processed:" + cat $CHECKLOG/package_errors.log + eend 0 + fi +fi +# }}} + # BUILD_OUTPUT - execute arch specific stuff and squashfs {{{ [ -n "$BUILD_OUTPUT" ] || BUILD_OUTPUT="$OUTPUT/grml_cd" mkdir -p "$BUILD_OUTPUT" || bailout 6 "Problem with creating $BUILD_OUTPUT for stage ARCH" @@ -1101,23 +1120,6 @@ fi # }}} # finalize {{{ -CHECKLOG=/var/log/fai/$HOSTNAME/last -# package validator -if [ -r "$CHECKLOG/package_errors.log" ] && grep -q '[a-z]' "$CHECKLOG/package_errors.log" ; then - - if [ -n "$EXIT_ON_MISSING_PACKAGES" ] ; then - eerror "The following packages were requested for installation but could not be processed:" - cat $CHECKLOG/package_errors.log - eerror "... exiting as requested via \$EXIT_ON_MISSING_PACKAGES." - eend 1 - bailout 13 - else - ewarn "The following packages were requested for installation but could not be processed:" - cat $CHECKLOG/package_errors.log - eend 0 - fi -fi - [ -n "$start_seconds" ] && SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]" || SECONDS="unknown" einfo "Successfully finished execution of $PN [$(date) - running ${SECONDS} seconds]" ; eend 0 log "Successfully finished execution of $PN [$(date) - running ${SECONDS} seconds]" -- 2.1.4