ensure --chroot-scripts always works v0.23
authorTong Sun <suntong@cpan.org>
Mon, 24 Nov 2008 22:51:59 +0000 (17:51 -0500)
committerMichael Prokop <mika@grml.org>
Mon, 24 Nov 2008 22:57:16 +0000 (23:57 +0100)
Make sure --chroot-scripts still works if its path does
not end with /chroot-scripts.

no sure it is necessary though.

grml-debootstrap

index 69f2cf0..245f0d8 100755 (executable)
@@ -765,8 +765,10 @@ preparechroot() {
 
   # copy scripts that should be executed inside the chroot:
   _opt_chroot_scripts=${_opt_chroot_scripts:-$CONFFILES/chroot-scripts/}
 
   # copy scripts that should be executed inside the chroot:
   _opt_chroot_scripts=${_opt_chroot_scripts:-$CONFFILES/chroot-scripts/}
-  [ -d $_opt_chroot_scripts -a "$CHROOT_SCRIPTS" = 'yes' ] && \
-    cp -a $VERBOSE $_opt_chroot_scripts $MNTPOINT/etc/debootstrap/
+  [ -d $_opt_chroot_scripts -a "$CHROOT_SCRIPTS" = 'yes' ] && {
+    mkdir -p $MNTPOINT/etc/debootstrap/chroot-scripts
+    cp -a $VERBOSE $_opt_chroot_scripts/* $MNTPOINT/etc/debootstrap/chroot-scripts/
+  }
 
   # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead!
   cp $VERBOSE $CHROOT_VARIABLES  $MNTPOINT/etc/debootstrap/variables
 
   # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead!
   cp $VERBOSE $CHROOT_VARIABLES  $MNTPOINT/etc/debootstrap/variables