summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_stats.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2014-09-28 14:08:17 +0200
committerHolger Levsen <holger@layer-acht.org>2014-09-28 14:08:17 +0200
commit8ccd470b94215a0b30d4f2879e76fef5e1c81d3a (patch)
treec5b4af6df2ec612c29af41f7b64811d3fe872516 /bin/reproducible_stats.sh
parent2682abe670d0794f40c6ebbf129bb69a0147887d (diff)
downloadjenkins.debian.net-8ccd470b94215a0b30d4f2879e76fef5e1c81d3a.tar.xz
reproducible: actually include statistics in the stats page
Diffstat (limited to 'bin/reproducible_stats.sh')
-rwxr-xr-xbin/reproducible_stats.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh
index dde556fc..21d54dfe 100755
--- a/bin/reproducible_stats.sh
+++ b/bin/reproducible_stats.sh
@@ -13,6 +13,8 @@ if [ ! -f $PACKAGES_DB ] ; then
exit 1
fi
+SUITE=sid
+AMOUNT=$(sqlite3 $PACKAGES_DB "SELECT amount FROM source_stats WHERE suite = \"$SUITE\"" | xargs echo)
GOOD=$(sqlite3 $PACKAGES_DB "SELECT name FROM source_packages WHERE status = \"reproducible\" ORDER BY name" | xargs echo)
COUNT_GOOD=$(sqlite3 $PACKAGES_DB "SELECT COUNT(name) FROM source_packages WHERE status = \"reproducible\"")
BAD=$(sqlite3 $PACKAGES_DB "SELECT name FROM source_packages WHERE status = \"unreproducible\" ORDER BY build_date DESC" | xargs echo)
@@ -22,6 +24,9 @@ COUNT_UGLY=$(sqlite3 $PACKAGES_DB "SELECT COUNT(name) FROM source_packages WHERE
SOURCELESS=$(sqlite3 $PACKAGES_DB "SELECT name FROM source_packages WHERE status = \"404\" ORDER BY build_date DESC" | xargs echo)
COUNT_SOURCELESS=$(sqlite3 $PACKAGES_DB "SELECT COUNT(name) FROM source_packages WHERE status = \"404\"" | xargs echo)
COUNT_TOTAL=$(sqlite3 $PACKAGES_DB "SELECT COUNT(name) FROM source_packages")
+PERCENT_TOTAL=$(echo "scale=3 ; ($COUNT_TOTAL*100/$AMOUNT)" | bc)
+PERCENT_GOOD=$(echo "scale=3 ; ($COUNT_GOOD*100/$COUNT_TOTAL)" | bc)
+PERCENT_BAD=$(echo "scale=3 ; ($COUNT_BAD*100/$COUNT_TOTAL)" | bc)
htmlecho() {
echo "$1" >> index.html
@@ -31,7 +36,8 @@ rm index.html
htmlecho "<html><body>" > index.html
htmlecho "<h2>Simple statistics for reproducible builds</h2>"
htmlecho "<p>Results were obtaining by <a href=\"$JENKINS_URL/view/reproducible\">several jobs running on jenkins.debian.net</a>.</p>"
-htmlecho "<p>$COUNT_BAD packages failed to built reproducibly: <code>"
+htmlecho "<p>$COUNT_TOTAL packages attempted to build so far, out of $AMOUNT in $SUITE currently. That's $PERCENT_TOTAL%!</p>"
+htmlecho "<p>$COUNT_BAD packages ($PERCENT_BAD%) failed to built reproducibly: <code>"
for PKG in $BAD ; do
VERSION=$(sqlite3 $PACKAGES_DB "SELECT version FROM source_packages WHERE name = \"$PKG\"")
htmlecho "<a href=\"$JENKINS_URL/userContent/diffp/${PKG}_${VERSION}.diffp\">$PKG </a> "
@@ -40,8 +46,7 @@ htmlecho "</code></p>"
htmlecho
htmlecho "<p>$COUNT_UGLY packages failed to build from source: <code>${UGLY}</code></p>"
htmlecho "<p>$COUNT_SOURCELESS packages which don't exist in sid and need investigation: <code>$SOURCELESS<code></p>"
-htmlecho "<p>$COUNT_TOTAL packages attempted to build in total.</p>"
-htmlecho "<p>$COUNT_GOOD packages successfully built reproducibly: <code>${GOOD}</code></p>"
+htmlecho "<p>$COUNT_GOOD packages ($PERCENT_GOOD%) successfully built reproducibly: <code>${GOOD}</code></p>"
htmlecho "<hr><font size='-1'><a href=\"$JENKINS_URL/userContent/diffp.html\">Static URL for this page.</a> Last modified: $(date)</font>"
htmlecho "</p></body></html>"