[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Debian real-world: calculate results once (per pkg) and save them in the fs

Holger Levsen gitlab at salsa.debian.org
Thu Feb 21 13:59:13 GMT 2019


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


Commits:
1ddf3f8c by Holger Levsen at 2019-02-21T13:58:56Z
reproducible Debian real-world: calculate results once (per pkg) and save them in the fs

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
=====================================
@@ -17,7 +17,7 @@ set -e
 
 # TODOs:
 # - ${package_file}.sha1output includes ${package_file} in the file name and contents
-# - run on osuoslXXX ? harder with using db..
+# - run job on jenkins, then do work via ssh on osuoslXXX ?
 # - GRAPH
 # - save results in db
 # - loop through all packages known in db
@@ -104,12 +104,23 @@ for package in $packages ; do
 	mkdir -p $pool_dir
 	cd $pool_dir
 	if [ "$MODE" = "results" ] ; then
-	        if  [ -e ${package_file}.json ] ; then
+		if [ -e ${package_file}.REPRODUCIBLE.$RELEASE ] ; then
+			count=$(cat ${package_file}.REPRODUCIBLE.$RELEASE)
+			SHA1SUM_PKG="$(cat ${package_file}.sha1output | awk '{print $1}' )"
+			echo "$(date -u) - REPRODUCIBLE: $package_file ($SHA1SUM_PKG) - reproduced $count times."
+		elif [ -e ${package_file}.UNREPRODUCIBLE.$RELEASE ] ; then
+			count=1
+			SHA1SUM_PKG="$(cat ${package_file}.sha1output | awk '{print $1}' )"
+			echo "$(date -u) - UNREPRODUCIBLE: $package_file ($SHA1SUM_PKG) only on ftp.debian.org."
+		else  [ -e ${package_file}.json ] ; then
+			# this code block can be removed once all packages with existing results have been processed once...
 			count=$(fmt ${package_file}.json | grep -c '\.buildinfo' || true)
 			SHA1SUM_PKG="$(cat ${package_file}.sha1output | awk '{print $1}' )"
 			if [ "${count}" -ge 2 ]; then
+				echo $count > ${package_file}.REPRODUCIBLE.$RELEASE
 				echo "$(date -u) - REPRODUCIBLE: $package_file ($SHA1SUM_PKG) - reproduced $count times."
 			else
+				echo 1 > ${package_file}.UNREPRODUCIBLE.$RELEASE
 				echo "$(date -u) - UNREPRODUCIBLE: $package_file ($SHA1SUM_PKG) only on ftp.debian.org."
 			fi
 		fi
@@ -121,6 +132,9 @@ for package in $packages ; do
 		echo "$(date -u) - calculating sha1sum for ${package_file}"
 		SHA1SUM_PKG="$(sha1sum ${package_file} | tee ${package_file}.sha1output | awk '{print $1}' )"
 		rm ${package_file}
+		if [ -n "$(ls ${package}_*REPRODUCIBLE.$RELEASE 2>/dev/null)" ] ; then
+			rm ${package}_*REPRODUCIBLE.$RELEASE
+			echo "$(date -u) - $package was updated, result for old version deleted."
 	else
 		echo "$(date -u) - ${package_file} is known, gathering sha1sum"
 		SHA1SUM_PKG="$(cat ${package_file}.sha1output | awk '{print $1}' )"
@@ -128,6 +142,15 @@ for package in $packages ; do
 	if [ ! -e ${package_file}.json ]; then
 		echo "$(date -u) - downloading .json for ${package_file} (${SHA1SUM_PKG}) from buildinfo.debian.net"
 		wget --quiet -O ${package_file}.json ${bdn_url}/${SHA1SUM_PKG} || echo "WARNING: failed to download ${bdn_url}/${SHA1SUM_PKG}"
+		count=$(fmt ${package_file}.json | grep -c '\.buildinfo' || true)
+		SHA1SUM_PKG="$(cat ${package_file}.sha1output | awk '{print $1}' )"
+		if [ "${count}" -ge 2 ]; then
+			echo $count > ${package_file}.REPRODUCIBLE.$RELEASE
+			echo "$(date -u) - REPRODUCIBLE: $package_file ($SHA1SUM_PKG) - reproduced $count times."
+		else
+			echo 1 > ${package_file}.UNREPRODUCIBLE.$RELEASE
+			echo "$(date -u) - UNREPRODUCIBLE: $package_file ($SHA1SUM_PKG) only on ftp.debian.org."
+		fi
 	else
 		echo "$(date -u) - reusing local copy of .json for ${package_file} (${SHA1SUM_PKG}) from buildinfo.debian.net"
 	fi



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/1ddf3f8cece3f0589d5ce97582e24dc2394e5ff8
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/20190221/69187b99/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list