This patch allows debootstrap to be run with the http_proxy environment
variable. This is principally useful when you're using apt-cacher and
apt-cacher-ng locally.
| ... | ... |
@@ -15,6 +15,7 @@ usage() {
|
| 15 | 15 |
|
| 16 | 16 |
echo >&2 |
| 17 | 17 |
echo >&2 'options: (not recommended)' |
| 18 |
+ echo >&2 " -p set an http_proxy for debootstrap" |
|
| 18 | 19 |
echo >&2 " -v $variant # change default debootstrap variant" |
| 19 | 20 |
echo >&2 " -i $include # change default package includes" |
| 20 | 21 |
echo >&2 " -d # strict debootstrap (do not apply any docker-specific tweaks)" |
| ... | ... |
@@ -44,8 +45,11 @@ debianUnstable=sid |
| 44 | 44 |
# this should match the name found at http://releases.ubuntu.com/ |
| 45 | 45 |
ubuntuLatestLTS=precise |
| 46 | 46 |
|
| 47 |
-while getopts v:i:a:dst name; do |
|
| 47 |
+while getopts v:i:a:p:dst name; do |
|
| 48 | 48 |
case "$name" in |
| 49 |
+ p) |
|
| 50 |
+ http_proxy="$OPTARG" |
|
| 51 |
+ ;; |
|
| 49 | 52 |
v) |
| 50 | 53 |
variant="$OPTARG" |
| 51 | 54 |
;; |
| ... | ... |
@@ -117,7 +121,7 @@ set -x |
| 117 | 117 |
|
| 118 | 118 |
# bootstrap |
| 119 | 119 |
mkdir -p "$target" |
| 120 |
-sudo debootstrap --verbose --variant="$variant" --include="$include" --arch="$arch" "$suite" "$target" "$mirror" |
|
| 120 |
+sudo http_proxy=$http_proxy debootstrap --verbose --variant="$variant" --include="$include" --arch="$arch" "$suite" "$target" "$mirror" |
|
| 121 | 121 |
|
| 122 | 122 |
cd "$target" |
| 123 | 123 |
|