summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_setup_pbuilder.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-12-23 22:33:41 +0100
committerHolger Levsen <holger@layer-acht.org>2016-12-23 22:33:41 +0100
commit68cb7afaea771f0be3829c574b83dcf1693691e4 (patch)
treeb8c3755c600ea58d68380851df4dd2124f4d6ea9 /bin/reproducible_setup_pbuilder.sh
parent2f8c4192372ab4001d3b03e8ac9dc96fbca55ec3 (diff)
downloadjenkins.debian.net-68cb7afaea771f0be3829c574b83dcf1693691e4.tar.xz
reproducible Debian: refactor, split create_setup_tmpfile() in two
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_setup_pbuilder.sh')
-rwxr-xr-xbin/reproducible_setup_pbuilder.sh45
1 files changed, 32 insertions, 13 deletions
diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh
index c70aac3f..c7d5bd51 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