[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#500759: Parsing of --unpack-tarball contradicts man page



Package: debootstrap
Version: 1.0.10

Hi debootstrap-Team, 

When building a OpenVZ template using debootstrap, I stumbled across the 
handling of --unpack-tarball. According to the manual-page, the syntax is 

  --unpack-tarball=foo.tgz

However I get the following on my system:

# debootstrap --unpack-tarball=unstable-pkgs.tgz sid sid-root 
http://ftp.de.debian.org/debian

It works when using --unpack-tarball $(pwd)/unstable-pkgs.tgz

Anyway, the options parser should match the manual page. Please consider 
applying attached patch (or something along these lines).

Greetings, Torsten
diff -Nur debootstrap-1.0.10/debootstrap debootstrap-1.0.10.1/debootstrap
--- debootstrap-1.0.10/debootstrap	2008-01-20 09:33:33.000000000 +0100
+++ debootstrap-1.0.10.1/debootstrap	2008-10-01 08:20:11.000000000 +0200
@@ -203,16 +203,20 @@
 			error 1 NEEDARG "option requires an argument %s" "$1"
 		fi
 		;;
-	    --unpack-tarball)
-		if [ -n "$2" ] ; then
-			if [ ! -f "$2" ] ; then
-				error 1 NOTARBALL "%s: No such file or directory" "$2"
-			fi
+	    --unpack-tarball|--unpack-tarball=?*)
+		if [ "$1" = "--unpack-tarball" -a -n "$2" ] ; then
 			UNPACK_TARBALL="$2"
-			shift 2
+                        shift 2
+                elif [ "$1" != "${1#--unpack-tarball=}" ]; then
+                        UNPACK_TARBALL="${1#--unpack-tarball=}"
+                        shift
 		else
 			error 1 NEEDARG "option requires an argument %s" "$1"
 		fi
+
+		if [ ! -f "$UNPACK_TARBALL" ] ; then
+			error 1 NOTARBALL "%s: No such file or directory" "$UNPACK_TARBALL"
+		fi
 		;;
 	    --include|--include=?*)
 		if [ "$1" = "--include" -a -n "$2" ]; then

Reply to: