Merge branch 'master' of ssh://git@git.grml.org/grml-debootstrap
[grml-debootstrap.git] / grml-debootstrap
index 01c7665..984aa1a 100755 (executable)
@@ -11,7 +11,6 @@ set -e # exit on any error
 
 # variables {{{
 PN="$(basename $0)"
-prog_real=`readlink -f -- $0`
 VERSION='0.23'
 MNTPOINT="/mnt/debootstrap.$$"
 
@@ -105,7 +104,7 @@ fi
 
 # cmdline handling {{{
 # source external command line parameter-processing script
-. $prog_real.clp
+. /usr/share/grml-debootstrap/functions/cmdlineopts.clp
 
 # == business-logic of command line parameter-processing
 
@@ -119,6 +118,8 @@ fi
   if ! . "$CONFFILES/config" ; then
     eerror "Error reading config file $CONFFILES/config" ; eend 1 ; exit 1
   fi
+  # restore the command line parameter value
+  CONFFILES=$_opt_confdir
 }
 # }}}
 
@@ -728,6 +729,7 @@ preparechroot() {
   [ -n "$MIRROR" ]       && echo "CHROOTMIRROR=$MIRROR"       >> $CHROOT_VARIABLES
   [ -n "$MIRROR" ]       && echo "MIRROR=$MIRROR"             >> $CHROOT_VARIABLES
   [ -n "$KEEP_SRC_LIST" ] && echo "KEEP_SRC_LIST=$KEEP_SRC_LIST" >> $CHROOT_VARIABLES
+  [ -n "$PACKAGES" ]     && echo "PACKAGES=$PACKAGES"         >> $CHROOT_VARIABLES
   [ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
   [ -n "$TARGET" ]       && echo "TARGET=$TARGET"             >> $CHROOT_VARIABLES
   [ -n "$TARGET_UUID" ]  && echo "TARGET_UUID=$TARGET_UUID"   >> $CHROOT_VARIABLES