[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible OpenWrt: correctly calculate percentage of reproducible packages and images

Holger Levsen gitlab at salsa.debian.org
Sun Oct 21 12:04:47 BST 2018


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


Commits:
f67e6260 by Holger Levsen at 2018-10-21T11:04:34Z
reproducible OpenWrt: correctly calculate percentage of reproducible packages and images

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

- - - - -


1 changed file:

- bin/reproducible_openwrt.sh


Changes:

=====================================
bin/reproducible_openwrt.sh
=====================================
@@ -560,7 +560,11 @@ for target in * ; do
 	done
 	cd ..
 done
-GOOD_PERCENT_IMAGES=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc | grep -qs . || echo 0.00)
+if [ $ALL_IMAGES -ne 0 ] ; then
+	GOOD_PERCENT_IMAGES=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc )
+else
+	GOOD_PERCENT_IMAGES=0
+fi
 # run diffoscope on the packages
 GOOD_PACKAGES=0
 ALL_PACKAGES=0
@@ -609,7 +613,11 @@ echo "       </table>" >> "$DBD_HTML"
 echo "       <table><tr><th>Reproducible packages</th></tr>" >> "$DBD_HTML"
 cat "$DBD_GOOD_PKGS_HTML" >> "$DBD_HTML"
 echo "       </table>" >> "$DBD_HTML"
-GOOD_PERCENT_PACKAGES=$(echo "scale=1 ; ($GOOD_PACKAGES*100/$ALL_PACKAGES)" | bc | grep -qs . || echo 0.00)
+if [ $ALL_PACKAGES -ne 0 ] ; then
+	GOOD_PERCENT_PACKAGES=$(echo "scale=1 ; ($GOOD_PACKAGES*100/$ALL_PACKAGES)" | bc )
+else
+	GOOD_PERCENT_PACKAGES=0
+fi
 # are we there yet?
 if [ "$GOOD_PERCENT_IMAGES" = "100.0" ] || [ "$GOOD_PERCENT_PACKAGES" = "100.0" ]; then
 	MAGIC_SIGN="!"



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/f67e6260eafed2dfdd47125b4a3546be80a296bf
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/20181021/251412f6/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list