From 8d81c0427c35b403da140332d4333f0b2882f621 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Tue, 7 Oct 2014 19:58:43 +0200 Subject: reproducible: refactor, provide dd-list on seperate page --- bin/reproducible_stats.sh | 79 +++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 30 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index 281d20b8..c0047566 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -20,6 +20,9 @@ declare -A BAD declare -A UGLY declare -A SOURCELESS declare -A NOTFORUS +declare -A STAR +declare -A LINKTARGET +declare -A SPOKENTARGET LAST24="AND build_date > datetime('now', '-24 hours') " LAST48="AND build_date > datetime('now', '-48 hours') " SUITE=sid @@ -54,8 +57,11 @@ PERCENT_UGLY=$(echo "scale=1 ; ($COUNT_UGLY*100/$COUNT_TOTAL)" | bc) PERCENT_NOTFORUS=$(echo "scale=1 ; ($COUNT_NOTFORUS*100/$COUNT_TOTAL)" | bc) PERCENT_SOURCELESS=$(echo "scale=1 ; ($COUNT_SOURCELESS*100/$COUNT_TOTAL)" | bc) GUESS_GOOD=$(echo "$PERCENT_GOOD*$AMOUNT/100" | bc) -declare -A STAR -declare -A LINKTARGET +SPOKENTARGET["all"]="all tested packages" +SPOKENTARGET["last_24h"]="packages tested in the last 24h" +SPOKENTARGET["last_48h"]="packages tested in the last 48h" +SPOKENTARGET["dd-list"]="maintainers of unreproducible packages" + write_summary() { echo "$1" >> $SUMMARY @@ -147,39 +153,52 @@ link_packages() { done } -echo "Processing packages... this will take a while." -EXTRA_STAR=true -process_packages ${BAD["all"]} -EXTRA_STAR=false -process_packages ${UGLY["all"]} ${GOOD["all"]} - -SPOKENTARGET["all"]="all tested packages" -SPOKENTARGET["last_24h"]="packages tested in the last 24h" -SPOKENTARGET["last_48"]="packages tested in the last 48h" - -MAINVIEW="last_24h" -ALLVIEWS="all last_24h last_48h" -for VIEW in $ALLVIEWS ; do - SUMMARY=index_${VIEW}.html - echo "Starting to write $SUMMARY page." +write_summary_header() { rm -f $SUMMARY write_summary "" write_summary "" write_summary "" write_summary "

Statistics for reproducible builds

" - if [ "$VIEW" = "$MAINVIEW" ] ; then + if [ "$1" = "$MAINVIEW" ] ; then write_summary "

This page is updated every three hours. Results are obtained from several build jobs running on jenkins.debian.net. Thanks to Profitbricks for donating the virtual machine it's running on!

" write_summary "

$COUNT_TOTAL packages attempted to build so far, that's $PERCENT_TOTAL% of $AMOUNT source packages in Debian $SUITE currently. Out of these, $PERCENT_GOOD% were successful, so quite wildly guessing this roughy means about $GUESS_GOOD packages should be reproducibly buildable! Join #debian-reproducible on OFTC to get support for making sure your packages build reproducibly too!

" fi write_summary "

Other views for the build results:

" write_summary "
" +} + +write_summary_footer() { + write_summary "

Static URL for this page. Last modified: $(date). Copyright 2014 Holger Levsen, GPL-2 licensed. About jenkins.debian.net" + write_summary "

" +} + +publish_summary() { + cp $SUMMARY /var/lib/jenkins/userContent/ + if [ "$VIEW" = "$MAINVIEW" ] ; then + cp $SUMMARY /var/lib/jenkins/userContent/reproducible.html + fi + rm $SUMMARY +} + +echo "Processing packages... this will take a while." +EXTRA_STAR=true +process_packages ${BAD["all"]} +EXTRA_STAR=false +process_packages ${UGLY["all"]} ${GOOD["all"]} + +MAINVIEW="last_24h" +ALLVIEWS="all last_24h last_48h" +for VIEW in $ALLVIEWS ; do + SUMMARY=index_${VIEW}.html + echo "Starting to write $SUMMARY page." + write_summary_header $VIEW write_summary "

$COUNT_BAD packages ($PERCENT_BAD% of $COUNT_TOTAL) failed to built reproducibly: " link_packages ${BAD[$VIEW]} write_summary "

" @@ -200,16 +219,16 @@ for VIEW in $ALLVIEWS ; do write_summary "

$COUNT_GOOD packages ($PERCENT_GOOD%) successfully built reproducibly: " link_packages ${GOOD[$VIEW]} write_summary "

" - write_summary "

Packages which failed to build reproducibly, sorted by Maintainers: and Uploaders: fields

" - write_summary "

$(echo ${BAD[$VIEW]} | dd-list -i) 

" - write_summary "

Static URL for this page. Last modified: $(date). Copyright 2014 Holger Levsen, GPL-2 licensed. About jenkins.debian.net" - write_summary "

" - # publish - cp $SUMMARY /var/lib/jenkins/userContent/ - if [ "$VIEW" = "$MAINVIEW" ] ; then - cp $SUMMARY /var/lib/jenkins/userContent/reproducible.html - fi - rm $SUMMARY + write_summary_footer + publish_summary done +VIEW=dd-list +SUMMARY=index_${VIEW}.html +echo "Starting to write $SUMMARY page." +write_summary_header $VIEW +write_summary "

Packages which failed to build reproducibly, sorted by Maintainers: and Uploaders: fields

" +write_summary "

$(echo ${BAD["all"]} | dd-list -i) 

" +write_summary_footer + publish_summary -- cgit v1.2.3-70-g09d2