summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-10-18 15:06:42 +0200
committerHolger Levsen <holger@layer-acht.org>2014-10-18 15:15:17 +0200
commitda205d0c42ee816cf341c22e5392c56efe1a7573 (patch)
treeb7c6c4cea7279ddb06db6cc2e21eea9fc4da398e
parent99694c18be1ab079118bfb8f43c9362382d3757d (diff)
downloadjenkins.debian.net-da205d0c42ee816cf341c22e5392c56efe1a7573.tar.xz
reproducible: cleanup
-rwxr-xr-xbin/reproducible_setup.sh30
1 files changed, 20 insertions, 10 deletions
diff --git a/bin/reproducible_setup.sh b/bin/reproducible_setup.sh
index 2c31efbc..5466f755 100755
--- a/bin/reproducible_setup.sh
+++ b/bin/reproducible_setup.sh
@@ -33,11 +33,11 @@ else
fi
cd $WORKSPACE
-#
-# finally, setup pbuilder
-#
-TMPFILE=$(mktemp)
-cat > ${TMPFILE} <<- EOF
+create_setup_tmpfile() {
+ #
+ # script to configure a pbuilder chroot
+ #
+ cat > ${TMPFILE} <<- EOF
#
# this script is run within the pbuilder environment to further customize it
#
@@ -79,10 +79,20 @@ echo
for i in \$(dpkg -l |grep ^ii |awk -F' ' '{print \$2}'); do apt-cache madison "\$i" | head -1 | grep reproducible.alioth.debian.org || true ; done
echo
EOF
+}
+
+setup_pbuilder() {
#
-# actually setup pbuilder
+# setup pbuilder for reproducible builds
#
-sudo pbuilder --create --basetgz /var/cache/pbuilder/base-reproducible-new.tgz --distribution sid
-sudo pbuilder --execute --save-after-exec --basetgz /var/cache/pbuilder/base-reproducible-new.tgz -- ${TMPFILE}
-sudo mv /var/cache/pbuilder/base-reproducible-new.tgz /var/cache/pbuilder/base-reproducible.tgz
-rm ${TMPFILE}
+ echo "$(date) - creating /var/cache/pbuilder/${1}.tgz now..."
+ TMPFILE=$(mktemp)
+ create_setup_tmpfile
+ sudo pbuilder --create --basetgz /var/cache/pbuilder/${1}-new.tgz --distribution sid
+ sudo pbuilder --execute --save-after-exec --basetgz /var/cache/pbuilder/${1}-new.tgz -- ${TMPFILE}
+ sudo mv /var/cache/pbuilder/${1}-new.tgz /var/cache/pbuilder/${1}.tgz
+ rm ${TMPFILE}
+ echo
+}
+
+setup_pbuilder base-reproducible