The patch makes debootstrap check if the target architecture is the same 
as the autodetected one and also improves the documentation of the --arch 
switch.

Note: the fact that you can't cross-install is documented in the readme, 
although not really too clearly.

Uli

---

--- debootstrap/debootstrap     2005-05-04 12:34:53.248401104 +0200
+++ debootstrap.tmp/debootstrap 2005-05-04 12:37:08.851786256 +0200
@@ -35,8 +35,9 @@
     echo "Bootstrap Debian base system."
     echo
     cat <<EOF
-      --arch                 set the target architecture (use if no dpkg)
-                               [ --arch powerpc ]
+      --arch                 set the architecture when dpkg is not installed, 
+                             defaults to the output of 
+                             'dpkg --print-installation-architecture'
       --download-only        download packages, but don't perform installation
       --print-debs           print the packages to be installed, and exit
       --unpack-tarball       acquire .debs from a tarball instead of http
@@ -168,17 +169,26 @@
 TARGET="${TARGET%/}"
 MIRRORS="${MIRRORS%/}"
 
-if [ "$ARCH" != "" ]; then
-       true
-elif [ -x /usr/bin/dpkg ] && /usr/bin/dpkg --print-installation-architecture 
>/dev/null 2>&1
-then
-       ARCH=`/usr/bin/dpkg --print-installation-architecture`
+# try two ways of autodetecting target architecture
+if [ -x /usr/bin/dpkg ]; then
+       AUTO_ARCH=`/usr/bin/dpkg --print-installation-architecture`
 elif [ -e $DEBOOTSTRAP_DIR/arch ]; then
-       ARCH=`cat $DEBOOTSTRAP_DIR/arch`
-else
+       AUTO_ARCH=`cat $DEBOOTSTRAP_DIR/arch`
+fi
+
+if [ -z "$ARCH" ] && [ -z "$AUTO_ARCH" ]; then
        error 1 WHATARCH "Couldn't work out current architecture"
 fi
 
+if [ -n "$ARCH" ] && [ -n "$AUTO_ARCH" ] && [ "$ARCH" != "$AUTO_ARCH" ]; then
+       error 1 WHATARCH "Conflicting architectures from commandline and 
autodetection"
+fi
+
+if [ -z "$ARCH" ]; then
+       # no arch specified, use autodetected value
+       ARCH="$AUTO_ARCH"
+fi
+
 export MIRRORS ARCH SUITE TARGET
 
 if [ "$JUST_PRINT_DEBS" = "" ] && [ "$DOWNLOAD_ONLY" = "" ] && [ -x 
/usr/bin/id ] && [ `id -u` -ne 0 ]; then


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to