From 8ab67eded30d05a613d1f0f8c6c5420d8fe93948 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 8 Apr 2011 11:48:33 -0400 Subject: Clear all global variables used for options, so that unclean environment doesn't break debootstrap. Closes: #621657 With the notable exception of SHA_SIZE, which is used to communicate with debootstrap. Also, upper-cased a few global variables. --- debian/changelog | 2 ++ debootstrap | 34 +++++++++++++++++++++++++--------- functions | 2 +- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3c15b01..a1f8ee2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ debootstrap (1.0.30) UNRELEASED; urgency=low * Needs base-installer 1.117. * Add a warning message if the keyring file is not available, and --no-check-gpg is not specified. + * Clear all global variables used for options, so that unclean + environment doesn't break debootstrap. Closes: #621657 -- Joey Hess Fri, 25 Mar 2011 14:12:43 -0400 diff --git a/debootstrap b/debootstrap index 0ca832d..e7e2a44 100755 --- a/debootstrap +++ b/debootstrap @@ -27,6 +27,22 @@ USE_COMPONENTS=main KEYRING="" DISABLE_KEYRING="" VARIANT="" +ARCH="" +KEEP_DEBOOTSTRAP_DIR="" +USE_BOOTFLOPPIES_INTERACTION="" +USE_DEBIANINSTALLER_INTERACTION="" +SECOND_STAGE_ONLY="" +CHROOTDIR="" +MAKE_TARBALL="" +KEEP_DEBOOTSTRAP_DIR="" +EXTRACTOR_OVERRIDE="" +UNPACK_TARBALL="" +ADDITIONAL="" +EXCLUDE="" +VERBOSE="" +CERTIFICATE="" +CHECKCERTIF="" +PRIVATEKEY="" DEF_MIRROR="http://ftp.us.debian.org/debian" @@ -242,31 +258,31 @@ if [ $# != 0 ] ; then ;; --include|--include=?*) if [ "$1" = "--include" -a -n "$2" ]; then - additional="$2" + ADDITIONAL="$2" shift 2 elif [ "$1" != "${1#--include=}" ]; then - additional="${1#--include=}" + ADDITIONAL="${1#--include=}" shift 1 else error 1 NEEDARG "option requires an argument %s" "$1" fi - additional="$(echo "$additional" | tr , " ")" + ADDITIONAL="$(echo "$ADDITIONAL" | tr , " ")" ;; --exclude|--exclude=?*) if [ "$1" = "--exclude" -a -n "$2" ]; then - exclude="$2" + EXCLUDE="$2" shift 2 elif [ "$1" != "${1#--exclude=}" ]; then - exclude="${1#--exclude=}" + EXCLUDE="${1#--exclude=}" shift 1 else error 1 NEEDARG "option requires an argument %s" "$1" fi - exclude="$(echo "$exclude" | tr , " ")" + EXCLUDE="$(echo "$EXCLUDE" | tr , " ")" ;; --verbose) - verbose=true - export verbose + VERBOSE=true + export VERBOSE shift 1 ;; --components|--components=?*) @@ -529,7 +545,7 @@ if am_doing_phase finddebs; then work_out_debs - base=$(without "$base $additional" "$exclude") + base=$(without "$base $ADDITIONAL" "$EXCLUDE") if [ "$RESOLVE_DEPS" = true ]; then requiredX=$(echo $(echo $required | tr ' ' '\n' | sort | uniq)) diff --git a/functions b/functions index f0ffe10..46f4b78 100644 --- a/functions +++ b/functions @@ -61,7 +61,7 @@ progress_next () { } wgetprogress () { - [ ! "$verbose" ] && QSWITCH="-q" + [ ! "$VERBOSE" ] && QSWITCH="-q" local ret=0 if [ "$USE_DEBIANINSTALLER_INTERACTION" ] && [ "$PROGRESS_NEXT" ]; then wget "$@" 2>&1 >/dev/null | $PKGDETAILS "WGET%" $PROGRESS_NOW $PROGRESS_NEXT $PROGRESS_END >&3 -- cgit v0.12