From 8d4cf26cb02147374f7f668ad48f56da664c8f40 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 27 Nov 2009 22:26:18 +0000 Subject: * Refactor deb extractors into two new functions. * Use dpkg-deb if available instead of ar (closes: #557296). * Add an --extractor option to override the automatic extractor selection. r61537 --- debootstrap | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'debootstrap') diff --git a/debootstrap b/debootstrap index ac821b8..171a5ef 100755 --- a/debootstrap +++ b/debootstrap @@ -90,6 +90,8 @@ usage() Run second stage in a subdirectory instead of root (can be used to create a foreign chroot) (requires --second-stage) + --extractor=TYPE override automatic .deb extractor selection + (supported: $EXTRACTORS_SUPPORTED) --boot-floppies used for internal purposes by boot-floppies --debian-installer used for internal purposes by debian-installer EOF @@ -201,6 +203,24 @@ if [ $# != 0 ] ; then error 1 NEEDARG "option requires an argument %s" "$1" fi ;; + --extractor|--extractor=?*) + if [ "$1" = "--extractor" -a -n "$2" ] ; then + EXTRACTOR_OVERRIDE="$2" + shift 2 + elif [ "$1" != "${1#--extractor=}" ]; then + EXTRACTOR_OVERRIDE="${1#--extractor=}" + shift + else + error 1 NEEDARG "option requires an argument %s" "$1" + fi + if valid_extractor "$EXTRACTOR_OVERRIDE"; then + if ! type "$EXTRACTOR_OVERRIDE" >/dev/null 2>&1; then + error 1 MISSINGEXTRACTOR "The selected extractor cannot be found: %s" "$EXTRACTOR_OVERRIDE" + fi + else + error 1 BADEXTRACTOR "%s: unknown extractor" "$EXTRACTOR_OVERRIDE" + fi + ;; --unpack-tarball|--unpack-tarball=?*) if [ "$1" = "--unpack-tarball" -a -n "$2" ] ; then UNPACK_TARBALL="$2" @@ -517,6 +537,8 @@ if am_doing_phase maketarball; then fi if am_doing_phase first_stage; then + choose_extractor + # first stage sets up the chroot -- no calls should be made to # "chroot $TARGET" here; but they should be possible by the time it's # finished -- cgit v1.2.3