summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-04-04 21:14:11 +0200
committerHolger Levsen <holger@layer-acht.org>2015-04-05 14:35:27 +0200
commit77837786ad7d9fbfb606703c3313f4f66456498b (patch)
tree3f58d7fb3a2844a142908897a0cb7899eb8c4ee4
parent826506614f3acb760fc2185e8ce79d12cd3d095a (diff)
downloadjenkins.debian.net-77837786ad7d9fbfb606703c3313f4f66456498b.tar.xz
schroot-create/reproducible_setup_pbuilder: configure the proxy inside the chroot IFF http_proxy is defined
-rwxr-xr-xbin/reproducible_setup_pbuilder.sh12
-rwxr-xr-xbin/schroot-create.sh4
2 files changed, 12 insertions, 4 deletions
diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh
index bbdff54f..ea407d2a 100755
--- a/bin/reproducible_setup_pbuilder.sh
+++ b/bin/reproducible_setup_pbuilder.sh
@@ -89,10 +89,16 @@ setup_pbuilder() {
echo "echo 'deb-src $MIRROR experimental main' >> /etc/apt/sources.list.d/experimental.list" >> ${TMPFILE}
fi
# use host apt proxy configuration for pbuilder too
- echo "echo '$(cat /etc/apt/apt.conf.d/80proxy)' > /etc/apt/apt.conf.d/80proxy" >> ${TMPFILE}
+ if [ ! -z "$http_proxy" ] ; then
+ echo "echo '$(cat /etc/apt/apt.conf.d/80proxy)' > /etc/apt/apt.conf.d/80proxy" >> ${TMPFILE}
+ pbuilder_http_proxy="--http-proxy $http_proxy"
+ fi
create_setup_tmpfile ${TMPFILE} "${PACKAGES}"
- sudo pbuilder --create --http-proxy $http_proxy --basetgz /var/cache/pbuilder/${NAME}-new.tgz --distribution $SUITE
- sudo pbuilder --execute --http-proxy $http_proxy --save-after-exec --basetgz /var/cache/pbuilder/${NAME}-new.tgz -- ${TMPFILE} | tee ${LOG}
+ sudo pbuilder --create $pbuilder_http_proxy --basetgz /var/cache/pbuilder/${NAME}-new.tgz --distribution $SUITE
+ if [ "$DEBUG" = "true" ] ; then
+ cat "$TMPFILE"
+ fi
+ sudo pbuilder --execute $pbuilder_http_proxy --save-after-exec --basetgz /var/cache/pbuilder/${NAME}-new.tgz -- ${TMPFILE} | tee ${LOG}
echo
echo "Now let's see whether the correct packages where installed..."
for PKG in ${PACKAGES} ; do
diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh
index cec1563c..2293dff5 100755
--- a/bin/schroot-create.sh
+++ b/bin/schroot-create.sh
@@ -98,7 +98,9 @@ bootstrap() {
echo -e '#!/bin/sh\nexit 101' | sudo tee $CHROOT_TARGET/usr/sbin/policy-rc.d >/dev/null
sudo chmod +x $CHROOT_TARGET/usr/sbin/policy-rc.d
- echo "Acquire::http::Proxy \"$http_proxy\";" | sudo tee $CHROOT_TARGET/etc/apt/apt.conf.d/80proxy >/dev/null
+ if [ ! -z "$http_proxy" ] ; then
+ echo "Acquire::http::Proxy \"$http_proxy\";" | sudo tee $CHROOT_TARGET/etc/apt/apt.conf.d/80proxy >/dev/null
+ fi
echo "deb-src $MIRROR $SUITE main" | sudo tee -a $CHROOT_TARGET/etc/apt/sources.list > /dev/null
for i in $(seq 0 5) ; do
[ -z "${EXTRA_SOURCES[$i]}" ] || echo "${EXTRA_SOURCES[$i]}" | sudo tee -a $CHROOT_TARGET/etc/apt/sources.list >/dev/null