[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] Print zero (not an empty) string when division denomination is zero.

Holger Levsen gitlab at salsa.debian.org
Sun Aug 12 21:04:28 BST 2018


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


Commits:
c1cbac45 by Chris Lamb at 2018-08-12T20:03:48Z
Print zero (not an empty) string when division denomination is zero.

Fixes, eg. "(% images and 99.0% packages reproducible in our current test framework.)"

- - - - -


1 changed file:

- bin/reproducible_lede.sh


Changes:

=====================================
bin/reproducible_lede.sh
=====================================
--- a/bin/reproducible_lede.sh
+++ b/bin/reproducible_lede.sh
@@ -153,7 +153,7 @@ for target in * ; do
 	done
 	cd ..
 done
-GOOD_PERCENT_IMAGES=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc)
+GOOD_PERCENT_IMAGES=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc | grep -qs . || echo 0.00)
 # run diffoscope on the packages
 GOOD_PACKAGES=0
 ALL_PACKAGES=0
@@ -200,7 +200,7 @@ 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)
+GOOD_PERCENT_PACKAGES=$(echo "scale=1 ; ($GOOD_PACKAGES*100/$ALL_PACKAGES)" | bc | grep -qs . || echo 0.00)
 # 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/c1cbac45299442bacf193178a1e06723243c573c

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/c1cbac45299442bacf193178a1e06723243c573c
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/20180812/a55dd9ad/attachment.html>


More information about the Qa-jenkins-scm mailing list