diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-03-02 19:16:15 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-03-02 19:24:56 +0100 |
commit | 5b9bbfbb4056ff7c075aabbef9ac8d566cb0b572 (patch) | |
tree | d91ac7125f9474405130dd12847520c20acbf178 /bin | |
parent | ad632336cb17eccb5f03cd01ca92c8d8ac88de99 (diff) | |
download | jenkins.debian.net-5b9bbfbb4056ff7c075aabbef9ac8d566cb0b572.tar.xz |
reproducible: update pbuilder base.tgz's 6 times a day and recreate them other day
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/reproducible_setup_pbuilder.sh | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh index a666361f..dd659732 100755 --- a/bin/reproducible_setup_pbuilder.sh +++ b/bin/reproducible_setup_pbuilder.sh @@ -98,8 +98,34 @@ setup_pbuilder() { || ( echo ; echo "Package ${PKG} is not installed at all or probably rather not in our version, so removing the chroot and exiting now." ; sudo rm -v /var/cache/pbuilder/${NAME}-new.tgz ; exit 1 ) done sudo mv /var/cache/pbuilder/${NAME}-new.tgz /var/cache/pbuilder/${NAME}.tgz + # create stamp file to record initial creation date + touch /var/log/jenkins/${NAME}.tgz.stamp rm ${TMPFILE} - echo } -setup_pbuilder $SUITE $SUITE-reproducible-base dpkg dpkg-dev debhelper +# +# update pbuilder for reproducible builds +# +update_pbuilder() { + NAME=$1 + sudo pbuilder --update --basetgz /var/cache/pbuilder/${NAME}.tgz +} + +# +# main +# +BASETGZ=/var/cache/pbuilder/$SUITE-reproducible-base.tgz +STAMP=/var/log/jenkins/$SUITE-reproducible-base.tgz.stamp +OLDSTAMP=$(find $STAMP -mtime +1 -exec ls -lad {} \;) +if [ -n "$OLDSTAMP" ] || [ ! -f $BASETGZ ] || [ ! -f $STAMP ] ; then + if [ ! -f $BASETGZ ] ; then + echo "No $BASETGZ exists, creating a new one..." + else + echo "$BASETGZ outdated, creating a new one..." + fi + setup_pbuilder $SUITE $SUITE-reproducible-base dpkg dpkg-dev debhelper +else + echo "Updating $BASETGZ..." + update_pbuilder $SUITE-reproducible-base +fi +echo |