From ac0706fea6e3d3cfb4b7a59b2fb84c5a220a2b89 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Wed, 19 Dec 2007 15:52:11 +0000 Subject: * Make --second-stage not bother recalculating required and base as * Make --arch and other arguments accept both "--arch i386" and "--arch=i386" forms of specifying a parameter to avoid the inconsistency. r50523 --- debian/changelog | 5 ++- debootstrap | 111 +++++++++++++++++++++++++++++++++++++------------------ debootstrap.8 | 8 ++-- 3 files changed, 83 insertions(+), 41 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4fb03ea..0999fd5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,8 +13,11 @@ debootstrap (1.0.8) UNRELEASED; urgency=low * Add minbase variant for the sid script that only install apt (and its dependencies) instead of all of base. (Closes: Bug#351912, Bug#452654) - * Make --second-stage not bother recalculating required and base when + * Make --second-stage not bother recalculating required and base as it's not needed. + * Make --arch and other arguments accept both "--arch i386" and + "--arch=i386" forms of specifying a parameter to avoid the + inconsistency. -- Anthony Towns Fri, 07 Dec 2007 18:57:24 +1000 diff --git a/debootstrap b/debootstrap index 8872a60..c4b2b9d 100755 --- a/debootstrap +++ b/debootstrap @@ -73,8 +73,8 @@ usage() --download-only download packages, but don't perform installation --print-debs print the packages to be installed, and exit - --arch A set the target architecture (use if no dpkg) - [ --arch powerpc ] + --arch=A set the target architecture (use if no dpkg) + [ --arch=powerpc ] --include=A,B,C adds specified names to the list of base packages --exclude=A,B,C removes specified packages from the list @@ -85,9 +85,9 @@ usage() --keyring=K check Release files against keyring K --no-resolve-deps don't try to resolve dependencies automatically - --unpack-tarball T acquire .debs from a tarball instead of http - --make-tarball T download .debs and create a tarball (tgz format) - --second-stage-target DIR + --unpack-tarball=T acquire .debs from a tarball instead of http + --make-tarball=T download .debs and create a tarball (tgz format) + --second-stage-target=DIR Run second stage in a subdirectory instead of root (can be used to create a foreign chroot) (requires --second-stage) @@ -145,16 +145,18 @@ if [ $# != 0 ] ; then SECOND_STAGE_ONLY=true shift ;; - --second-stage-target) - if [ "$SECOND_STAGE_ONLY" = "true" ] ; then - if [ -n "$2" ] ; then - CHROOTDIR="$2" - shift 2 - else - error 1 NEEDARG "option requires an argument: %s" "$1" - fi + --second-stage-target|--second-stage-target=?*) + if [ "$SECOND_STAGE_ONLY" != "true" ] ; then + error 1 STAGE2ONLY "option %s only applies in the second stage" "$1" + fi + if [ "$1" = "--second-stage-target" -a -n "$2" ] ; then + CHROOTDIR="$2" + shift 2 + elif [ "$1" != "${1#--second-stage-target=}" ]; then + CHROOTDIR="${1#--second-stage-target=}" + shift else - error 1 NEEDARG "%s only applies in the second stage" "$1" + error 1 NEEDARG "option requires an argument: %s" "$1" fi ;; --print-debs) @@ -165,11 +167,14 @@ if [ $# != 0 ] ; then WHAT_TO_DO="finddebs dldebs" shift ;; - --make-tarball) + --make-tarball|--make-tarball=?*) WHAT_TO_DO="finddebs dldebs maketarball kill_target" - if [ -n "$2" ] ; then + if [ "$1" = "--make-tarball" -a -n "$2" ] ; then MAKE_TARBALL="$2" shift 2 + elif [ "$1" != "${1#--mnake-tarball=}" ]; then + MAKE_TARBALL="${1#--mnake-tarball=}" + shift else error 1 NEEDARG "option requires an argument %s" "$1" fi @@ -187,10 +192,13 @@ if [ $# != 0 ] ; then KEEP_DEBOOTSTRAP_DIR=true shift ;; - --arch) - if [ -n "$2" ] ; then + --arch|--arch=?*) + if [ "$1" = "--arch" -a -n "$2" ] ; then ARCH="$2" shift 2 + elif [ "$1" != "${1#--arch=}" ]; then + ARCH="${1#--arch=}" + shift else error 1 NEEDARG "option requires an argument %s" "$1" fi @@ -206,40 +214,71 @@ if [ $# != 0 ] ; then error 1 NEEDARG "option requires an argument %s" "$1" fi ;; - --include*) - additional="$(echo $1 | cut -f2 -d"="|tr , " ")" - shift 1 + --include|--include=?*) + if [ "$1" = "--include" -a -n "$2" ]; then + additional="$2" + shift 2 + elif [ "$1" != "${1#--include=}" ]; then + additional="${1#--include=}" + shift 1 + else + error 1 NEEDARG "option requires an argument %s" "$1" + fi + additional="$(echo "$additional" | tr , " ")" ;; - --exclude*) - exclude="$(echo $1 | cut -f2 -d"="|tr , " ")" - shift 1 + --exclude|--exclude=?*) + if [ "$1" = "--exclude" -a -n "$2" ]; then + exclude="$2" + shift 2 + elif [ "$1" != "${1#--exclude=}" ]; then + exclude="${1#--exclude=}" + shift 1 + else + error 1 NEEDARG "option requires an argument %s" "$1" + fi + exclude="$(echo "$exclude" | tr , " ")" ;; --verbose) verbose=true export verbose shift 1 ;; - --components*) - USE_COMPONENTS="$(echo "$1" | cut -f2 -d"="|tr , "|")" - if [ "$USE_COMPONENTS" = "" ]; then + --components|--components=?*) + if [ "$1" = "--components" -a -n "$2" ]; then + USE_COMPONENTS="$2" + shift 2 + elif [ "$1" != "${1#--components=}" ]; then + USE_COMPONENTS="${1#--components=}" + shift 1 + else error 1 NEEDARG "option requires an argument %s" "$1" fi - export USE_COMPONENTS - shift 1 + USE_COMPONENTS="$(echo "$USE_COMPONENTS" | tr , "|")" ;; - --variant*) - VARIANT="$(echo "$1" | cut -f2 -d"=")" - shift 1 + --variant|--variant=?*) + if [ "$1" = "--variant" -a -n "$2" ]; then + VARIANT="$2" + shift 2 + elif [ "$1" != "${1#--variant=}" ]; then + VARIANT="${1#--variant=}" + shift 1 + else + error 1 NEEDARG "option requires an argument %s" "$1" + fi ;; - --keyring*) + --keyring|--keyring=?*) if ! gpgv --version >/dev/null 2>&1; then error 1 NEEDGPGV "gpgv not installed, but required for Release verification" fi - KEYRING="$(echo "$1" | cut -f2 -d"=")" - if [ "$KEYRING" = "" ]; then + if [ "$1" = "--keyring" -a -n "$2" ]; then + KEYRING="$2" + shift 2 + elif [ "$1" != "${1#--keyring=}" ]; then + KEYRING="${1#--keyring=}" + shift 1 + else error 1 NEEDARG "option requires an argument %s" "$1" fi - shift 1 ;; *) break diff --git a/debootstrap.8 b/debootstrap.8 index 224ea59..3da899a 100644 --- a/debootstrap.8 +++ b/debootstrap.8 @@ -39,7 +39,7 @@ If you are looking for a chroot system to build packages please take a look at \fBpbuilder\fR. .SH "OPTIONS" .PP -.IP "\fB\-\-arch ARCH\fP" +.IP "\fB\-\-arch=ARCH\fP" Set the target architecture (use if dpkg isn't installed). See also \-\-foreign. .IP .IP "\fB\-\-include=alpha,beta\fP" @@ -98,7 +98,7 @@ installed as /debootstrap/debootstrap in the target filesystem. Complete the bootstrapping process. Other arguments are generally not needed. .IP -.IP "\fB\-\-second\-stage\-target DIR\fP" +.IP "\fB\-\-second\-stage\-target=DIR\fP" Run second stage in a subdirectory instead of root. (can be used to create a foreign chroot) (requires \-\-second\-stage) .IP @@ -106,10 +106,10 @@ a foreign chroot) (requires \-\-second\-stage) Don't delete the /debootstrap directory in the target after completing the installation. .IP -.IP "\fB\-\-unpack\-tarball FILE\fP" +.IP "\fB\-\-unpack\-tarball=FILE\fP" Acquire .debs from tarball FILE instead of downloading via http .IP -.IP "\fB\-\-make\-tarball FILE\fP" +.IP "\fB\-\-make\-tarball=FILE\fP" Instead of bootstrapping, make a tarball (written to FILE) of the downloaded packages. The resulting tarball may be passed to a later -- cgit v0.12