diff options
author | Johannes 'josch' Schauer <josch@mister-muffin.de> | 2017-11-20 09:11:08 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2017-11-20 08:39:23 +0000 |
commit | 014cc2a6be7b01c306e200dbef420dd3aba6f6f6 (patch) | |
tree | 41dd776b99c411cbb5f12ee37142b29174e83a49 /bin | |
parent | 5c89f72ff29eeb23db6034a08323d4c17b695506 (diff) | |
download | jenkins.debian.net-014cc2a6be7b01c306e200dbef420dd3aba6f6f6.tar.xz |
bin/find_dpkg_trigger_cycles.sh: Use true tmp dir and cleanup at the end
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/find_dpkg_trigger_cycles.sh | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh index 938f9942..c31ca01b 100755 --- a/bin/find_dpkg_trigger_cycles.sh +++ b/bin/find_dpkg_trigger_cycles.sh @@ -106,11 +106,16 @@ set -e ARCH="amd64" CODENAME="$1" -DIRECTORY="`pwd`/debian-$CODENAME-$ARCH" +DIRECTORY=$(mktemp --directory tmp.jenkins_find_dpkg_trigger_cycles_${ARCH}_${CODENAME}_XXXXXXXXXX) APT_OPTS="-y" #APT_OPTS=$APT_OPTS" -o Acquire::Check-Valid-Until=false" # because we use snapshot +function finish { + rm -rf "$DIRECTORY" +} +trap finish EXIT + mkdir -p $DIRECTORY mkdir -p $DIRECTORY/etc/apt/ mkdir -p $DIRECTORY/etc/apt/trusted.gpg.d/ @@ -185,12 +190,6 @@ printf "" > $DIRECTORY/interested-explicit printf "" > $DIRECTORY/activated-file printf "" > $DIRECTORY/activated-explicit -scratch=$(mktemp -d -t tmp.dpkg_trigger_cycles.XXXXXXXXXX) -function finish { - rm -rf "$scratch" -} -trap finish EXIT - # find all binary packages with /triggers$ # # We cannot use "apt-get --print-uris download" and use the python module @@ -203,7 +202,7 @@ curl --retry 3 --retry-delay 10 --globoff "http://binarycontrol.debian.net/?q=&p | sort -u \ | while read pkg url; do echo "working on $pkg..." >&2 - tmpdir=`mktemp -d --tmpdir="$scratch" -t dpkg-trigger-cycles-curl-XXXXXXXX` + tmpdir=$(mktemp -d --tmpdir="$DIRECTORY" dpkg-trigger-cycles-curl-XXXXXXXX) # we use curl as part of a pipeline to dpkg-deb instead of first # downloading to a temporary file and then using dpkg-deb on it, # because we do not want to download the full .deb (which could be very |