From 7fc7fb0c59266664b8c700e21859a7fbcc3d5052 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 12 Jun 2015 21:31:12 +0200 Subject: reproducible: define $TEMPDIR as /tmp/reproducible and teach all the to create temporary files under TEMPDIR (except for builders, they have their own TMPDIR), to avoid polluting /tmp --- bin/reproducible_setup_pbuilder.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/reproducible_setup_pbuilder.sh') diff --git a/bin/reproducible_setup_pbuilder.sh b/bin/reproducible_setup_pbuilder.sh index 1134f779..837f3b4f 100755 --- a/bin/reproducible_setup_pbuilder.sh +++ b/bin/reproducible_setup_pbuilder.sh @@ -82,8 +82,8 @@ setup_pbuilder() { PACKAGES="$@" EXTRA_PACKAGES="locales-all" echo "$(date) - creating /var/cache/pbuilder/${NAME}.tgz now..." - TMPFILE=$(mktemp) - LOG=$(mktemp) + TMPFILE=$(mktemp --tmpdir=$TEMPDIR pbuilder-XXXXXXXXX) + LOG=$(mktemp --tmpdir=$TEMPDIR pbuilder-XXXXXXXX) if [ "$SUITE" = "experimental" ] ; then SUITE=unstable echo "echo 'deb $MIRROR experimental main' > /etc/apt/sources.list.d/experimental.list" > ${TMPFILE} @@ -105,7 +105,7 @@ setup_pbuilder() { for PKG in ${PACKAGES} ; do grep "http://reproducible.alioth.debian.org/debian/ ./ Packages" ${LOG} \ | grep -v grep | grep "${PKG} " \ - || ( 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 ) + || ( 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 ; rm $TMPFILE $LOG ; exit 1 ) done sudo mv /var/cache/pbuilder/${NAME}-new.tgz /var/cache/pbuilder/${NAME}.tgz # create stamp file to record initial creation date -- cgit v1.2.3-70-g09d2