From 3e4905c545650a1e80a8e22b67c52deafa2667e0 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 5 Oct 2014 20:54:36 +0200 Subject: reproducible: use html framesets to provide easy+fast access to files --- bin/reproducible_stats.sh | 97 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 27 deletions(-) (limited to 'bin/reproducible_stats.sh') diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index 996eaefd..4efb0a3e 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -38,65 +38,108 @@ 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) -htmlecho() { +write_index() { echo "$1" >> index.html } +mkdir -p /var/lib/jenkins/userContent/rb-pkg/ +write_pkg_frameset() { + FRAMESET="/var/lib/jenkins/userContent/rb-pkg/$1.html" + cat > $FRAMESET <<-EOF + + + + + + + + + +EOF +} + +init_navi_frame() { + NAVI="/var/lib/jenkins/userContent/rb-pkg/$1_navigation.html" + echo "

" > $NAVI + echo "$1: " >> $NAVI +} + +append2navi_frame() { + echo "$2" >> $NAVI +} + +finish_navi_frame() { + echo "

" >> $NAVI +} + link_packages() { for PKG in $@ ; do VERSION=$(sqlite3 -init $INIT $PACKAGES_DB "SELECT version FROM source_packages WHERE name = \"$PKG\"") # remove epoch EVERSION=$(echo $VERSION | cut -d ":" -f2) - htmlecho $PKG # FIXME: remove unused code once all diffp.log and pbuilder.log files are gone if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] || [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.diffp.log" ] || [ -f "/var/lib/jenkins/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log" ] || [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] || [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ]; then - htmlecho " (" + write_index " $PKG " + MAINLINK="" + init_navi_frame "$PKG" if [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then - htmlecho " buildinfo " + append2navi_frame " buildinfo " + MAINLINK="$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" fi if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] ; then - htmlecho " debbindiff " + append2navi_frame " debbindiff " + MAINLINK="$JENKINS_URL/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" elif [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.diffp.log" ] ; then - htmlecho " diffp " + append2navi_frame " diffp " + MAINLINK="$JENKINS_URL/userContent/dbd/${PKG}_${EVERSION}.diffp.log" fi if [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ] ; then - htmlecho " rbuild " + append2navi_frame " rbuild " + if [ "$MAINLINK" = "" ] ; then + MAINLINK="$JENKINS_URL/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" + fi fi if [ -f "/var/lib/jenkins/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log" ] ; then - htmlecho " pbuilder " + append2navi_frame " pbuilder " + if [ "$MAINLINK" = "" ] ; then + MAINLINK="$JENKINS_URL/userContent/pbuilder/${PKG}_${EVERSION}.pbuilder.log" + fi fi - htmlecho ") " + finish_navi_frame + write_pkg_frameset "$PKG" "$MAINLINK" + else + write_index " $PKG " fi done } -htmlecho "" > index.html -htmlecho "

Statistics for reproducible builds

" -htmlecho "

Results were obtained by several jobs running on jenkins.debian.net. This page is updated after each job run.

" -htmlecho "

$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!

" -htmlecho "

$COUNT_BAD packages ($PERCENT_BAD% of $COUNT_TOTAL) failed to built reproducibly: " +write_index "" > index.html +write_index "

Statistics for reproducible builds

" +write_index "

Results were obtained by several jobs running on jenkins.debian.net. This page is updated after each job run.

" +write_index "

$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!

" +write_index "

$COUNT_BAD packages ($PERCENT_BAD% of $COUNT_TOTAL) failed to built reproducibly: " link_packages $BAD -htmlecho "

" -htmlecho -htmlecho "

$COUNT_UGLY packages ($PERCENT_UGLY%) failed to build from source: " +write_index "

" +write_index +write_index "

$COUNT_UGLY packages ($PERCENT_UGLY%) failed to build from source: " link_packages $UGLY -htmlecho "

" +write_index "

" if [ $COUNT_SOURCELESS -gt 0 ] ; then - htmlecho "

$COUNT_SOURCELESS ($PERCENT_SOURCELESS%) packages where the source could not be downloaded. $SOURCELESS

" + write_index "

$COUNT_SOURCELESS ($PERCENT_SOURCELESS%) packages where the source could not be downloaded. $SOURCELESS

" fi if [ $COUNT_NOTFORUS -gt 0 ] ; then - htmlecho "

$COUNT_NOTFORUS ($PERCENT_NOTFORUS%) packages which are neither Architecture: 'any' nor 'all' nor 'amd64' nor 'linux-amd64': $NOTFORUS

" + write_index "

$COUNT_NOTFORUS ($PERCENT_NOTFORUS%) packages which are neither Architecture: 'any' nor 'all' nor 'amd64' nor 'linux-amd64': $NOTFORUS

" fi if [ $COUNT_BLACKLISTED -gt 0 ] ; then - htmlecho "

$COUNT_BLACKLISTED packages are blacklisted and will never be tested here: $BLACKLISTED

" + write_index "

$COUNT_BLACKLISTED packages are blacklisted and will never be tested here: $BLACKLISTED

" fi -htmlecho "

$COUNT_GOOD packages ($PERCENT_GOOD%) successfully built reproducibly: " +write_index "

$COUNT_GOOD packages ($PERCENT_GOOD%) successfully built reproducibly: " link_packages $GOOD -htmlecho "

" -htmlecho "

Packages which failed to build reproducibly, sorted by Maintainers: and Uploaders: fields." -htmlecho "

$(echo $BAD | dd-list -i) 

" -htmlecho "

Static URL for this page. Last modified: $(date)" -htmlecho "

" +write_index "

" +write_index "

Packages which failed to build reproducibly, sorted by Maintainers: and Uploaders: fields." +write_index "

$(echo $BAD | dd-list -i) 

" +write_index "

Static URL for this page. Last modified: $(date)" +write_index "

" # job output html2text index.html -- cgit v1.2.3-70-g09d2