[Qa-jenkins-scm] [jenkins.debian.net] 01/01: find_dpkg_trigger_cycles: store all temp files in /tmp.dpkg_trigger_cycles.XXXXXXXXXX and remove using a trap on EXIT

Holger Levsen holger at moszumanska.debian.org
Sat Mar 28 10:43:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 78328d23da08f533b0738c907b1f90be6945e198
Author: josch <j.schauer at email.de>
Date:   Sat Mar 28 11:40:51 2015 +0100

    find_dpkg_trigger_cycles: store all temp files in /tmp.dpkg_trigger_cycles.XXXXXXXXXX and remove using a trap on EXIT
---
 bin/find_dpkg_trigger_cycles.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh
index 8e5f744..36460dc 100755
--- a/bin/find_dpkg_trigger_cycles.sh
+++ b/bin/find_dpkg_trigger_cycles.sh
@@ -146,6 +146,12 @@ 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$
 curl --globoff "http://binarycontrol.debian.net/?q=&path=${DIST}%2F[^%2F]%2B%2Ftriggers%24&format=pkglist" \
 	| xargs apt-get $APT_OPTS --print-uris download \
@@ -153,7 +159,7 @@ curl --globoff "http://binarycontrol.debian.net/?q=&path=${DIST}%2F[^%2F]%2B%2Ft
 	| sort \
 	| while read pkg url; do
 	echo "working on $pkg..." >&2
-	tmpdir=`mktemp -d`
+	tmpdir=`mktemp -d --tmpdir="$scratch"`
 	( curl --retry 2 --retry-delay 10 --location --silent "$url" || ( echo "curl failed with exit $?">&2; exit 1 ) ) \
 		| dpkg-deb --ctrl-tarfile /dev/stdin \
 		| tar -C "$tmpdir" --exclude=./md5sums -x

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list