#!/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