summaryrefslogtreecommitdiffstats
path: root/debootstrap
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@debian.org>2009-11-27 22:26:18 (GMT)
committerOtavio Salvador <otavio@debian.org>2009-11-27 22:26:18 (GMT)
commit8d4cf26cb02147374f7f668ad48f56da664c8f40 (patch)
tree1810394a14642441aa1bdcfbd88600db70b69b43 /debootstrap
parentd48c8e453ae75ee19b7a1a4a14c899209eac083e (diff)
downloaddebootstrap-8d4cf26cb02147374f7f668ad48f56da664c8f40.zip
debootstrap-8d4cf26cb02147374f7f668ad48f56da664c8f40.tar.gz
debootstrap-8d4cf26cb02147374f7f668ad48f56da664c8f40.tar.bz2
* 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
Diffstat (limited to 'debootstrap')
-rwxr-xr-xdebootstrap22
1 files changed, 22 insertions, 0 deletions
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