Skip to content

Commit

Permalink
add proxy support in install-chroot.sh
Browse files Browse the repository at this point in the history
BUG=126477
TEST=


Review URL: https://chromiumcodereview.appspot.com/10375036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136084 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
james.wei@intel.com committed May 9, 2012
1 parent f36f409 commit bb2c63a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions build/install-chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" &&
Expand Down Expand Up @@ -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' || :
Expand Down

0 comments on commit bb2c63a

Please sign in to comment.