Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5306)

Unified Diff: build/install-chroot.sh

Issue 10375036: add proxy support in install-chroot.sh (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: use double-quote around env varibles Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-chroot.sh
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
index 82caff2385ee87d160cbda474484fc9b182c340b..1743703cfbe02b572e8f404bfb412adbb3a93276 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -339,8 +339,9 @@ if [ -z "${mirror}" ]; then
mirror="http://archive.ubuntu.com/ubuntu" ||
mirror="http://ftp.us.debian.org/debian"
fi
- sudo debootstrap ${archflag} "${distname}" /var/lib/chroot/"${target}" \
- "$mirror"
+
+sudo ${http_proxy:+http_proxy="${http_proxy}"} debootstrap ${archflag} \
+ "${distname}" "/var/lib/chroot/${target}" "$mirror"
# Add new entry to /etc/schroot/schroot.conf
grep -qs ubuntu.com /usr/share/debootstrap/scripts/"${distname}" &&
@@ -552,6 +553,13 @@ sudo sed -i '/^deb[^-]/p
s/^deb\([^-]\)/deb-src\1/' \
"/var/lib/chroot/${target}/etc/apt/sources.list"
+# Set apt proxy if host has set http_proxy
+if [ -n "${http_proxy}" ]; then
+ sudo sh -c '
+ echo "Acquire::http::proxy \"'"${http_proxy}"'\";" \
+ >>"/var/lib/chroot/'"${target}"'/etc/apt/apt.conf"'
+fi
+
# Update packages
sudo "/usr/local/bin/${target%bit}" /bin/sh -c '
apt-get update; apt-get -y dist-upgrade' || :
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698