diff options
author | Holger Levsen <holger@layer-acht.org> | 2014-10-03 14:28:41 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2014-10-03 14:28:41 +0200 |
commit | 7b8623efe589f66ece38717f06657171c4cd9370 (patch) | |
tree | 5021872a1c666b626f0a90a653acd8f7a79b4a15 | |
parent | f873f6aeaeb01556853e32b6bcd991b1fdbf72ea (diff) | |
download | jenkins.debian.net-7b8623efe589f66ece38717f06657171c4cd9370.tar.xz |
reproducible: cleanup using trap
-rwxr-xr-x | bin/reproducible_build.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 18d5bc3b..62c1ec7d 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -120,7 +120,11 @@ echo "The following source packages will be build: ${PACKAGES}" echo "=============================================================================" echo -TMPDIR=$(mktemp --tmpdir=. -d) +cleanup_all() { + rm -r $TMPDIR +} + +TMPDIR=$(mktemp --tmpdir=$PWD -d) NUM_CPU=$(cat /proc/cpuinfo |grep ^processor|wc -l) COUNT_TOTAL=0 COUNT_GOOD=0 @@ -130,6 +134,7 @@ GOOD="" BAD="" SOURCELESS="" SKIPPED="" +trap cleanup_all INT TERM EXIT cd $TMPDIR for SRCPACKAGE in ${PACKAGES} ; do set +x @@ -229,7 +234,8 @@ for SRCPACKAGE in ${PACKAGES} ; do set -x done cd .. -rm -r $TMPDIR +cleanup_all +trap - INT TERM EXIT set +x echo |