[Qa-jenkins-scm] [jenkins.debian.net] 01/01: schroot-create/reproducible_setup_pbuilder: configure the proxy inside the chroot IFF http_proxy is defined

Holger Levsen holger at moszumanska.debian.org
Sun Apr 5 12:35:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 77837786ad7d9fbfb606703c3313f4f66456498b
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Sat Apr 4 21:14:11 2015 +0200

    schroot-create/reproducible_setup_pbuilder: configure the proxy inside the chroot IFF http_proxy is defined
---
 bin/reproducible_setup_pbuilder.sh | 12 +++++++++---
 bin/schroot-create.sh              |  4 +++-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh
index bbdff54..ea407d2 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 cec1563..2293dff 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list