Add support for EXIT_ON_MISSING_PACKAGES
authorMichael Prokop <mika@grml.org>
Sat, 12 Dec 2009 13:45:26 +0000 (14:45 +0100)
committerMichael Prokop <mika@grml.org>
Sat, 12 Dec 2009 13:45:26 +0000 (14:45 +0100)
debian/changelog
etc/grml/grml-live.conf
grml-live

index 50e96e9..b35c663 100644 (file)
@@ -18,6 +18,9 @@ grml-live (0.9.33) UNRELEASED; urgency=low
     for bringing this issue up, Richard Hartmann.
   * templates/boot/grub/menu.lst: drop bootoption lang=us, we
     specify the default within grml-autoconfig.
     for bringing this issue up, Richard Hartmann.
   * templates/boot/grub/menu.lst: drop bootoption lang=us, we
     specify the default within grml-autoconfig.
+  * Support configuration variable EXIT_ON_MISSING_PACKAGES to exit
+    with returncode != 0 if a requested package isn't available on the
+    resulting ISO.
   * Software related changes:
     - Add iscsitarget-module-2.6.31-grml64 to GRML_FULL.
     - Add nbd-server + nbd-client to GRML_FULL (thanks to Xuân Baldauf).
   * Software related changes:
     - Add iscsitarget-module-2.6.31-grml64 to GRML_FULL.
     - Add nbd-server + nbd-client to GRML_FULL (thanks to Xuân Baldauf).
@@ -33,7 +36,7 @@ grml-live (0.9.33) UNRELEASED; urgency=low
   [ Thorsten Glaser ]
   * Update MirOS bsd4grml to 20091115.
 
   [ Thorsten Glaser ]
   * Update MirOS bsd4grml to 20091115.
 
- -- Michael Prokop <mika@grml.org>  Wed, 25 Nov 2009 03:21:07 +0100
+ -- Michael Prokop <mika@grml.org>  Sat, 12 Dec 2009 14:44:14 +0100
 
 grml-live (0.9.32) unstable; urgency=low
 
 
 grml-live (0.9.32) unstable; urgency=low
 
index e4aad8b..096ece9 100644 (file)
 # URL for downloading the windows files:
 # WINDOWS_BINARIES="http://the.earth.li/~sgtatham/putty/latest/x86/"
 
 # 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
+# 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
+
 ## END OF FILE #################################################################
 ## END OF FILE #################################################################
index da67813..207f982 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -1104,9 +1104,18 @@ fi
 CHECKLOG=/var/log/fai/$HOSTNAME/last
 # package validator
 if [ -r "$CHECKLOG/package_errors.log" ] && grep -q '[a-z]' "$CHECKLOG/package_errors.log" ; then
 CHECKLOG=/var/log/fai/$HOSTNAME/last
 # package validator
 if [ -r "$CHECKLOG/package_errors.log" ] && grep -q '[a-z]' "$CHECKLOG/package_errors.log" ; then
-   ewarn "The following packages were requested for installation but could not be processed:"
-   cat $CHECKLOG/package_errors.log
-   eend 0
+
+   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"
 fi
 
 [ -n "$start_seconds" ] && SECONDS="$[$(cut -d . -f 1 /proc/uptime)-$start_seconds]" || SECONDS="unknown"