#!/bin/bash # Copyright 2014-2015 Holger Levsen # released under the GPLv=2 DEBUG=false . /srv/jenkins/bin/common-functions.sh common_init "$@" # common code . /srv/jenkins/bin/reproducible_common.sh # # create the webpage # DATE=$(date -u +'%Y-%m-%d') ARCHBASE=$BASE/archlinux cd $ARCHBASE PAGE=archlinux.html echo "$(date -u) - starting to build $PAGE" cat > $PAGE <<- EOF Repoducible Arch Linux ?!

Reproducible Arch Linux?!

EOF write_page_intro 'Arch Linux' write_explaination_table 'Arch Linux' write_page " " HTML_FTBFS=$(mktemp) HTML_FTBR=$(mktemp) HTML_DEPWAIT=$(mktemp) HTML_404=$(mktemp) HTML_GOOD=$(mktemp) HTML_UNKNOWN=$(mktemp) HTML_BUFFER=$(mktemp) HTML_TARGET="" for REPOSITORY in $ARCHLINUX_REPOS ; do for PKG in $(find $ARCHBASE/$REPOSITORY/* -maxdepth 1 -type d -exec basename {} \;) ; do if [ -z "$(cd $ARCHBASE/$REPOSITORY/$PKG/ ; ls)" ] ; then # directory exists but is empty: package is building… echo "$(date -u ) - ignoring $PKG from '$REPOSITORY' which is building right now…" continue fi echo " " >> $HTML_BUFFER echo " " >> $HTML_BUFFER echo " " >> $HTML_BUFFER echo " " >> $HTML_BUFFER echo " " >> $HTML_BUFFER for LOG in build1.log build2.log ; do if [ -f $ARCHBASE/$REPOSITORY/$PKG/$LOG ] ; then echo " " >> $HTML_BUFFER else echo " " >> $HTML_BUFFER fi done echo " " >> $HTML_BUFFER cat $HTML_BUFFER >> $HTML_TARGET rm $HTML_BUFFER > /dev/null done done for i in $HTML_UNKNOWN $HTML_FTBFS $HTML_DEPWAIT $HTML_404 $HTML_FTBR $HTML_GOOD ; do cat $i >> $PAGE rm $i > /dev/null done write_page "
repositorysource packagetest resulttest date1st build log2nd build log
$REPOSITORY$PKG" >> $HTML_BUFFER if [ -z "$(cd $ARCHBASE/$REPOSITORY/$PKG/ ; ls *.pkg.tar.xz.html 2>/dev/null)" ] ; then if [ ! -z "$(grep '==> ERROR: Could not resolve all dependencies' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_DEPWAIT echo " \"depwait could not resolve dependencies" >> $HTML_BUFFER elif [ ! -z "$(egrep '==> ERROR: .pacman. failed to install missing dependencies.' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_DEPWAIT echo " \"depwait failed to install dependencies" >> $HTML_BUFFER elif [ ! -z "$(egrep '==> ERROR: A failure occurred in (build|package)' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_FTBFS echo " \"ftbfs failed to build from source" >> $HTML_BUFFER elif [ ! -z "$(egrep '==> ERROR: A failure occurred in check' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_FTBFS echo " \"ftbfs failed to build from source, while running tests" >> $HTML_BUFFER elif [ ! -z "$(egrep '==> ERROR: Failure while downloading' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_404 echo " \"404 failed to download source" >> $HTML_BUFFER elif [ ! -z "$(egrep '==> ERROR: One or more files did not pass the validity check' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_FTBFS echo " \"ftbfs failed to verify source" >> $HTML_BUFFER elif [ ! -z "$(egrep 'makepkg was killed by timeout after' $ARCHBASE/$REPOSITORY/$PKG/build1.log)" ] ; then HTML_TARGET=$HTML_FTBFS echo " \"ftbfs failed to build, killed by timeout" >> $HTML_BUFFER else echo " probably failed to build from source, please investigate" >> $HTML_BUFFER HTML_TARGET=$HTML_UNKNOWN # or is it reproducible??? fi else HTML_TARGET=$HTML_FTBR for ARTIFACT in $(cd $ARCHBASE/$REPOSITORY/$PKG/ ; ls *.pkg.tar.xz.html) ; do echo " \"unreproducible ${ARTIFACT:0:-5} is unreproducible
" >> $HTML_BUFFER done fi echo "
$(LANG=C TZ=UTC ls --full-time $ARCHBASE/$REPOSITORY/$PKG/build1.log | cut -d ' ' -f6 )$LOG 
" write_page "
" write_page_footer 'Arch Linux' echo "$(date -u) - enjoy $REPRODUCIBLE_URL/archlinux/$PAGE"