summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-04-08 15:48:33 (GMT)
committerJoey Hess <joey@kitenet.net>2011-04-08 15:48:33 (GMT)
commit8ab67eded30d05a613d1f0f8c6c5420d8fe93948 (patch)
treeaed50d5a2fdf1d31f67bdf05f1e3d2d273f5e395
parentc72e1705e402c17255493a7c3062b3cc86ac3b72 (diff)
downloaddebootstrap-8ab67eded30d05a613d1f0f8c6c5420d8fe93948.zip
debootstrap-8ab67eded30d05a613d1f0f8c6c5420d8fe93948.tar.gz
debootstrap-8ab67eded30d05a613d1f0f8c6c5420d8fe93948.tar.bz2
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.
-rw-r--r--debian/changelog2
-rwxr-xr-xdebootstrap34
-rw-r--r--functions2
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 <joeyh@debian.org> 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