Print warning if grml2usb is not found in grml2iso.
authorUlrich Dangel <mru@grml.org>
Sat, 12 Feb 2011 13:33:07 +0000 (14:33 +0100)
committerUlrich Dangel <mru@grml.org>
Sat, 12 Feb 2011 13:33:07 +0000 (14:33 +0100)
Added helper message for running grml2iso from the source tree.

grml2iso

index 8e4e06a..8a07f1a 100755 (executable)
--- a/grml2iso
+++ b/grml2iso
@@ -83,8 +83,6 @@ Options:
      echo "Error: specified parameter for -c is not a directory" >&2
      exit 1
   fi
-
-  shift $(($OPTIND - 1))
 # }}}
 
 # we need root permissions for executing grml2usb {{{
@@ -94,6 +92,17 @@ Options:
   fi
 # }}}
 
+# check for grml2usb {{{
+  if [ ! -x "$(which $GRML2USB)" ] || [ ! -x "$GRML2USB" ] ; then
+    echo >&2 "Error: Could not find grml2usb"
+    if [ -x "./$GRML2USB" ] ; then
+      echo >&2 "If you executed grml2iso from the grml2usb repository use"
+      echo >&2 "GRML2USB=./grml2usb $0 $*"
+    fi
+    exit 1
+  fi
+# }}}
+
 # variables {{{
   ORIG_DIR="$(pwd)"
   # note: grub-pc_1.96+20090603-1 seems to be b0rken
@@ -113,9 +122,13 @@ Options:
 # }}}}
 
 # execute grml2usb with all ISOs you'd like to install {{{
+  # remove all parameters
+  shift $(($OPTIND - 1))
+
   $GRML2USB "${REMOVE_OPTS[@]}" ${ADD_OPTS:+"$ADD_OPTS"} "$@" "$WRKDIR/cddir"
 # }}}
 
+
 # move syslinux to isolinux {{{
   mv "$WRKDIR"/cddir/boot/syslinux "$WRKDIR"/cddir/boot/isolinux