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' || : |