Make sure it works on target directories
[grml-debootstrap.git] / grml-debootstrap
index d7b0daa..6aefe5d 100755 (executable)
@@ -11,7 +11,7 @@ set -e # exit on any error
 
 # variables {{{
 PN="$(basename $0)"
-VERSION='0.20'
+VERSION='0.21'
 MNTPOINT="/mnt/debootstrap.$$"
 
 # inside the chroot system locales might not be available, so use minimum:
@@ -686,7 +686,7 @@ debootstrap_system() {
   if ! grep -q $MNTPOINT /proc/mounts ; then
      mount_target
   fi
-  if grep -q $MNTPOINT /proc/mounts ; then
+  if grep -q $MNTPOINT /proc/mounts || [ -n "$DIRECTORY" ] ; then
      einfo "Running $DEBOOTSTRAP for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
      [ -n "$MIRROR" ] && $DEBOOTSTRAP $ARCHCMD $RELEASE $MNTPOINT $MIRROR || \
      $DEBOOTSTRAP $ARCHCMD $RELEASE $MNTPOINT $ISO