debootstrap from an ISO when ISO is set as MIRROR is always set
authorEvgeni Golov <evgeni@grml.org>
Wed, 1 Aug 2012 16:54:59 +0000 (18:54 +0200)
committerEvgeni Golov <evgeni@grml.org>
Wed, 1 Aug 2012 16:54:59 +0000 (18:54 +0200)
previously the ISO codepath was never executed as MIRROR was always set
and thus -n "$MIRROR" was never false

do NOT unset MIRROR in the ISO case so that the resulting chroot has a
proper mirror configured

grml-debootstrap

index bac2cd5..0aad703 100755 (executable)
@@ -1041,15 +1041,16 @@ debootstrap_system() {
     eend 1 ; exit 1
   fi
 
-  einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
-  if [ -n "$MIRROR" ] ; then
-    einfo "Executing: $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR"
-    $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR
-    RC=$?
-  else
+  if [ -n "$ISO" ] ; then
+    einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${ISO}"
     einfo "Executing: $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO"
     $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO
     RC=$?
+  else
+    einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${MIRROR}"
+    einfo "Executing: $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR"
+    $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR
+    RC=$?
   fi
 
   if [ $RC -ne 0 ] ; then