From c898e12ceaebb421269c135788516f52699aa01a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Fri, 10 Oct 2014 18:44:32 +0200 Subject: reproducible: use iframes --- bin/reproducible_stats.sh | 76 +++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 46 deletions(-) (limited to 'bin/reproducible_stats.sh') diff --git a/bin/reproducible_stats.sh b/bin/reproducible_stats.sh index 8c448cb3..8f656f84 100755 --- a/bin/reproducible_stats.sh +++ b/bin/reproducible_stats.sh @@ -256,25 +256,6 @@ write_summary() { echo "$1" >> $SUMMARY } -write_pkg_frameset() { - FRAMESET="/var/lib/jenkins/userContent/rb-pkg/$1.html" - cat > $FRAMESET <<-EOF - - - - - - $1 - reproducible builds results - - - - - - - -EOF -} - set_icon() { # icons taken from tango-icon-theme (0.8.90-5) # licenced under http://creativecommons.org/licenses/publicdomain/ @@ -303,22 +284,26 @@ set_icon() { esac } -init_navi_frame() { - echo "" > $NAVI - echo "" >> $NAVI - echo "Navigation for $1" >> $NAVI - echo "
$1 $2" >> $NAVI +init_pkg_page() { + echo "" > ${PKG_FILE} + echo "" >> ${PKG_FILE} + echo "$1 - reproducible builds results" >> ${PKG_FILE} + echo "
$1 $2" >> ${PKG_FILE} set_icon "$3" $5 - echo "\"${STATE_TARGET_NAME}" >> $NAVI - echo "at $4: " >> $NAVI + echo "\"${STATE_TARGET_NAME}" >> ${PKG_FILE} + echo "at $4: " >> ${PKG_FILE} } -append2navi_frame() { - echo "$1" >> $NAVI +append2pkg_page() { + echo "$1" >> ${PKG_FILE} } -finish_navi_frame() { - echo "reproducible builds
" >> $NAVI +finish_pkg_page() { + echo "
reproducible builds
" >> ${PKG_FILE} + echo "" >> ${PKG_FILE} + echo "" >> ${PKG_FILE} } set_package_class() { @@ -339,41 +324,40 @@ process_packages() { STAR[$PKG]="β" # used to be a star... fi # only build $PKG pages if they don't exist or are older than $BUILD_DATE - NAVI="/var/lib/jenkins/userContent/rb-pkg/${PKG}_navigation.html" - FILE=$(find $(dirname $NAVI) -name $(basename $NAVI) ! -newermt "$BUILD_DATE" 2>/dev/null || true) - # if no navigation exists, or is older than last build_date or if a note exist... - if [ ! -f $NAVI ] || [ "$FILE" != "" ] || [ "${NOTES_PACKAGE[${PKG}]}" != "" ] ; then + PKG_FILE="/var/lib/jenkins/userContent/rb-pkg/${PKG}.html" + OLD_FILE=$(find $(dirname ${PKG_FILE}) -name $(basename ${PKG_FILE}) ! -newermt "$BUILD_DATE" 2>/dev/null || true) + # if no package file exists, or is older than last build_date or if a note exist... + if [ ! -f ${PKG_FILE} ] || [ "$OLD_FILE" != "" ] || [ "${NOTES_PACKAGE[${PKG}]}" != "" ] ; then VERSION=$(echo $RESULT | cut -d "|" -f2) STATUS=$(echo $RESULT | cut -d "|" -f3) MAINLINK="" - init_navi_frame "$PKG" "$VERSION" "$STATUS" "$BUILD_DATE" "${STAR[$PKG]}" - append2navi_frame "${NOTES_PACKAGE[${PKG}]}" + init_pkg_page "$PKG" "$VERSION" "$STATUS" "$BUILD_DATE" "${STAR[$PKG]}" + append2pkg_page "${NOTES_PACKAGE[${PKG}]}" if [ -f "/var/lib/jenkins/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" ] ; then - append2navi_frame " buildinfo " + append2pkg_page " buildinfo " MAINLINK="$JENKINS_URL/userContent/buildinfo/${PKG}_${EVERSION}_amd64.buildinfo" fi if [ -f "/var/lib/jenkins/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" ] ; then - append2navi_frame " debbindiff " + append2pkg_page " debbindiff " MAINLINK="$JENKINS_URL/userContent/dbd/${PKG}_${EVERSION}.debbindiff.html" fi RBUILD_LOG="rbuild/${PKG}_${EVERSION}.rbuild.log" if [ -f "/var/lib/jenkins/userContent/${RBUILD_LOG}" ] ; then SIZE=$(du -sh "/var/lib/jenkins/userContent/${RBUILD_LOG}" |cut -f1) - append2navi_frame " rbuild ($SIZE) " + append2pkg_page " rbuild ($SIZE) " if [ "$MAINLINK" = "" ] ; then MAINLINK="$JENKINS_URL/userContent/${RBUILD_LOG}" fi fi - append2navi_frame " PTS " - append2navi_frame " BTS " - append2navi_frame " sources " - append2navi_frame " debian/rules " + append2pkg_page " PTS " + append2pkg_page " BTS " + append2pkg_page " sources " + append2pkg_page " debian/rules " if [ "${NOTES_PACKAGE[${PKG}]}" != "" ] ; then MAINLINK="$JENKINS_URL/userContent/notes/${PKG}_note.html" fi - finish_navi_frame - write_pkg_frameset "$PKG" "$MAINLINK" + finish_pkg_page "$MAINLINK" fi if [ -f "/var/lib/jenkins/userContent/rbuild/${PKG}_${EVERSION}.rbuild.log" ] ; then set_package_class @@ -405,7 +389,7 @@ write_summary_header() { write_summary "$2" write_summary "

$2

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

These pages are updated every six 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 "

These pages are updated every six hours. Results are obtained from several jobs running on jenkins.debian.net. Thanks to Profitbricks for donating the virtual machine it's running on!

" fi write_summary "

$COUNT_TOTAL packages have been attempted to be 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!" if [ "${1:0:3}" = "all" ] || [ "$1" = "dd-list" ] ; then -- cgit v1.2.3-70-g09d2