From 934f3cece022357f65c07170d482ad511bbee453 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Fri, 24 Jan 2003 05:03:08 +0000 Subject: [PATCH] First cut at a script to process the logfile maintained by 'buildsuccess' and 'buildfailure' and produce a HTML output listing ports with the date they became broken. The output can surely be made more useful (e.g. it always links to the ${branch}-latest logs, which may not exist when the build-in-progress has not yet attempted the build of that port). --- Tools/portbuild/scripts/processfail | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 Tools/portbuild/scripts/processfail diff --git a/Tools/portbuild/scripts/processfail b/Tools/portbuild/scripts/processfail new file mode 100755 index 000000000000..67f77369e6a8 --- /dev/null +++ b/Tools/portbuild/scripts/processfail @@ -0,0 +1,68 @@ +#!/bin/sh +# +# processfail + +arch=$1 +branch=$2 + +pb=/var/portbuild + +of=/usr/local/www/data/errorlogs/.${arch}-${branch}-failure.html + +cd ${pb}/${arch}/${branch} + +find $of .failure.html.lock -mmin +60 -delete 2>/dev/null + +if [ -f $of -o -f .failure.html.lock ]; then exit; fi + +if [ -e .newfailure.stamp -a $(echo $(find . -maxdepth 1 -newer .newfailure.stamp -name newfailure 2>&1 /dev/null | wc -l)) = "0" ]; then exit; fi + +touch .newfailure.stamp +touch .failure.html.lock + +newfailure=${pb}/${arch}/${branch}/newfailure +num=$(wc -l ${newfailure}) + +header() { + echo "New package building errors" >$of + echo "

New package building errors

" >>$of + + if [ "$num" -eq "0" ]; then + echo "No errors (yet)" >>$of + else + echo "" >>$of + echo "$1" >>$of + fi +} + +footer() { + echo "
" >>$of + echo "" >>$of + echo "" >>$of +} + +# +# Create "default" output, sorted on portname +# +header "PortPackageDate broken" + +for i in `cat ${newfailure}`; do + set $(echo $i | tr ' ' '_' | tr \| " ") + + echo "" >> $of + echo "$1" >> $of + echo "$3" >> $of + +# echo "$affby$4 Kb" >> $of +# echo "$5" >> $of +# echo "$6" >> $of +# echo "" >> $of + + date=$(echo $4 | tr '_' ' ') + echo "${date}" >> $of + + echo "" >> $of +done +footer "" +rm .failure.html.lock +mv -f $of /usr/local/www/data/errorlogs/${arch}-${branch}-failure.html