From fc54c5f8d984f156a3c2540c1c7a85241b09f6e6 Mon Sep 17 00:00:00 2001
From: "Rui Miguel P. Bernardo" <rui.bernardo.pt@gmail.com>
Date: Sat, 26 May 2012 17:28:45 +0100
Subject: [PATCH 1/2] also use LB_APT_HTTP_PROXY in lb_bootstrap_debootstrap

---
 scripts/build/lb_bootstrap_debootstrap |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/scripts/build/lb_bootstrap_debootstrap b/scripts/build/lb_bootstrap_debootstrap
index b83ee02..512e6c9 100755
--- a/scripts/build/lb_bootstrap_debootstrap
+++ b/scripts/build/lb_bootstrap_debootstrap
@@ -115,6 +115,14 @@ fi
 
 if [ -x "/usr/sbin/debootstrap" ]
 then
+
+	if [ -n "$LB_APT_HTTP_PROXY" ]
+	then
+		PREVIOUS_PROXY_ENV="${http_proxy}"
+		export http_proxy="${LB_APT_HTTP_PROXY}"
+	fi
+
+
 	if [ "${LB_CACHE_PACKAGES}" = "true" ]
 	then
 		if ls cache/packages_bootstrap/*.deb > /dev/null 2>&1
@@ -167,6 +175,13 @@ then
 	# Deconfiguring debootstrap configurations
 	rm -f chroot/etc/hosts
 
+	# Deconfiguring http_proxy
+	if [ -n "$LB_APT_HTTP_PROXY" ]
+	then
+		export http_proxy="${PREVIOUS_PROXY_ENV}"
+		[ "$PREVIOUS_PROXY_ENV" = "" ] && unset http_proxy
+	fi
+
 	# Removing bootstrap cache
 	rm -f chroot/var/cache/apt/archives/*.deb
 
-- 
1.7.10

