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

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: add http_proxy check 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..529d8320b758448ed45627a7eda89a3028221fd9 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -339,8 +339,14 @@ 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"
+
+if [ -n "${http_proxy}" ]; then
+ PROXY_FLAG="http_proxy=${http_proxy}"
+else
+ PROXY_FLAG=""
+fi
+sudo ${PROXY_FLAG} debootstrap ${archflag} "${distname}" \
Markus (顧孟勤) 2012/05/08 02:09:57 You could probably write this more concisely as:
Wei James(wistoch) 2012/05/08 02:47:58 done. thanks
+ "/var/lib/chroot/${target}" "$mirror"
# Add new entry to /etc/schroot/schroot.conf
grep -qs ubuntu.com /usr/share/debootstrap/scripts/"${distname}" &&
@@ -552,6 +558,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}'\";" \
Markus (顧孟勤) 2012/05/08 02:09:57 While it probably is benign in this particular cas
Wei James(wistoch) 2012/05/08 02:47:58 for the syntax requirement, we need a double-quote
+ >>"/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