[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#640992: please improve proxy support



Control: tag -1 +patch *

diff --git a/debootstrap b/debootstrap
index 8fbf954..d4dfea2 100755
--- a/debootstrap
+++ b/debootstrap
@@ -447,6 +447,19 @@ if ! doing_variant fakechroot && command -v apt-config >/dev/null; then
     fi
 fi
 
+###########################################################################
+# keep apt conf proxy settings in chroot #640992
+#   export env for dldebs setup phase, and below during first_stage config apt
+APT_CONF_PROXY=""
+if ! doing_variant fakechroot && command -v apt-config >/dev/null; then
+    eval "$(apt-config shell APT_CONF_PROXY Acquire::http::Proxy)"
+    if [ -n "$APT_CONF_PROXY" ]; then
+        info APT_CONF_PROXY "Using apt conf proxy for setup: $APT_CONF_PROXY"
+        http_proxy="$APT_CONF_PROXY"
+        export http_proxy
+    fi
+fi
+
 ###########################################################################
 if [ -n "$DISABLE_KEYRING" ] && [ -n "$FORCE_KEYRING" ]; then
 	error 1 BADARG "Both --no-check-gpg and --force-check-gpg specified, please pick one (at most)"
@@ -803,6 +816,12 @@ if am_doing_phase first_stage; then
 	else
 		setup_apt_sources "$DEF_MIRROR"
 	fi
+
+    # configure apt proxy settings within chroot if detected above #640992
+    if [ -n "$APT_CONF_PROXY" ]; then
+        info APT_CONF_PROXY "Configuring apt proxy: $APT_CONF_PROXY"
+        echo 'Acquire::http::Proxy "'$APT_CONF_PROXY'";' >> $TARGET/etc/apt/apt.conf.d/90proxy
+    fi
 fi
 
 if am_doing_phase second_stage; then


Reply to: