[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian: avoid one cd command per loop run

Holger Levsen gitlab at salsa.debian.org
Wed Feb 20 20:36:04 GMT 2019


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
cad543cb by Holger Levsen at 2019-02-20T20:35:10Z
reproducible Debian: avoid one cd command per loop run

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/reproducible_compare_Debian_sha1sums.sh


Changes:

=====================================
bin/reproducible_compare_Debian_sha1sums.sh
=====================================
@@ -45,7 +45,6 @@ log=$(mktemp --tmpdir=$TMPDIR sha1-log-XXXXXXX)
 
 SHA1DIR=/srv/reproducible-results/debian-sha1
 mkdir -p $SHA1DIR
-cd $SHA1DIR
 
 PACKAGES=$(mktemp --tmpdir=$TMPDIR sha1-pkgs-XXXXXXX)
 schroot --directory  $SHA1DIR -c chroot:jenkins-reproducible-${RELEASE}-diffoscope cat /var/lib/apt/lists/cdn-fastly.deb.debian.org_debian_dists_${RELEASE}_main_binary-amd64_Packages > $PACKAGES
@@ -85,11 +84,10 @@ cleanup_all() {
 
 trap cleanup_all INT TERM EXIT
 
-rm -f *.lock	# this is a tiny bit hackish, but also an elegant way to get rid of old locks...
-		# (locks are held for 30s only anyway and there is an 3/60000th chance of a race condition only anyway)
+rm -f $SHA1DIR/*.lock	# this is a tiny bit hackish, but also an elegant way to get rid of old locks...
+			# (locks are held for 30s only anyway and there is an 3/60000th chance of a race condition only anyway)
 
 for package in $packages ; do
-	cd $SHA1DIR
 	LOCK="$SHA1DIR/${package}.lock"
 	if [ -e $LOCK ] ; then
 		echo "$(date -u) - skipping locked package $package, sleeping a minute to deescalate."
@@ -101,7 +99,7 @@ for package in $packages ; do
 	version=$(grep-dctrl -X -P ${package} -s version -n $PACKAGES)
 	arch=$(grep-dctrl -X -P ${package} -s Architecture -n $PACKAGES)
 	package_file="${package}_$(echo $version | sed 's#:#%3a#')_${arch}.deb"
-	pool_dir="$(dirname $(grep-dctrl -X -P ${package} -s Filename -n $PACKAGES))"
+	pool_dir="$SHA1DIR/$(dirname $(grep-dctrl -X -P ${package} -s Filename -n $PACKAGES))"
 	mkdir -p $pool_dir
 	cd $pool_dir
 	if [ "$MODE" = "results" ] ; then



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/cad543cb3103407a1344d45ff2562a64cab572f6

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/cad543cb3103407a1344d45ff2562a64cab572f6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20190220/1e2f6df4/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list