[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible Debian: refactor, split create_setup_tmpfile() in two

Holger Levsen holger at layer-acht.org
Fri Dec 23 21:33:51 UTC 2016


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 68cb7afaea771f0be3829c574b83dcf1693691e4
Author: Holger Levsen <holger at layer-acht.org>
Date:   Fri Dec 23 22:33:41 2016 +0100

    reproducible Debian: refactor, split create_setup_tmpfile() in two
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_setup_pbuilder.sh | 45 +++++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 13 deletions(-)

diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh
index c70aac3..c7d5bd5 100755
--- a/bin/reproducible_setup_pbuilder.sh
+++ b/bin/reproducible_setup_pbuilder.sh
@@ -20,12 +20,33 @@ fi
 #
 # create script to configure a pbuilder chroot
 #
-create_setup_tmpfile() {
+create_customized_tmpfile ()
 	TMPFILE=$1
 	shift
 	cat >> $TMPFILE <<- EOF
 #
-# this script is run within the pbuilder environment to further customize it
+# this script is run within the pbuilder environment to further customize initially
+#
+echo
+echo "Configuring APT to ignore the Release file expiration"
+echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/398future
+echo
+echo "Working around debootstrap bug https://bugs.debian.org/817236"
+if [ -L /dev/ptmx ]; then
+	rm /dev/ptmx
+	mknod -m 666 /dev/ptmx c 5 2
+fi
+echo ".. done"
+echo
+EOF
+}
+
+create_setup_our_repo_tmpfile() {
+	TMPFILE=$1
+	shift
+	cat >> $TMPFILE <<- EOF
+#
+# this script is run within the pbuilder environment to further customize once more
 #
 echo "-----BEGIN PGP PUBLIC KEY BLOCK-----
 Version: GnuPG v1.4.12 (GNU/Linux)
@@ -58,16 +79,6 @@ peNsYNcna2Ca8Imozzc5L424lXN3MaiTql7Y1lZJFF5Y/wznbjUQj/5YXj3LVB3W
 -----END PGP PUBLIC KEY BLOCK-----" | apt-key add -
 echo 'deb http://reproducible.alioth.debian.org/debian/ ./' > /etc/apt/sources.list.d/reproducible.list
 echo
-echo "Configuring APT to ignore the Release file expiration"
-echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/398future
-echo
-echo "Working around debootstrap bug https://bugs.debian.org/817236"
-if [ -L /dev/ptmx ]; then
-	rm /dev/ptmx
-	mknod -m 666 /dev/ptmx c 5 2
-fi
-echo ".. done"
-echo
 apt-get update
 apt-get -y upgrade
 apt-get install -y $@
@@ -108,10 +119,18 @@ setup_pbuilder() {
 	# setup base.tgz
 	sudo pbuilder --create $pbuilder_http_proxy --basetgz /var/cache/pbuilder/${NAME}-new.tgz --distribution $SUITE --extrapackages "$EXTRA_PACKAGES"
 
+	# customize pbuilder
+	create_customized_tmpfile ${TMPFILE}
+	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}
+	rm ${TMPFILE}
+
 	# add repo only for experimental and sid - keep testing "real" (and sid progressive!)
 	if [ "$SUITE" != "testing" ] ; then
 		# apply further customisations, eg. install $PACKAGES from our repo
-		create_setup_tmpfile ${TMPFILE} "${PACKAGES}"
+		create_setup_our_repo_tmpfile ${TMPFILE} "${PACKAGES}"
 		if [ "$DEBUG" = "true" ] ; then
 			cat "$TMPFILE"
 		fi

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