--- processlogs.kris 2008-09-17 03:31:16.274246185 +0000 +++ processlogs.linimon 2008-09-17 04:19:34.326534115 +0000 @@ -4,6 +4,7 @@ # summarizing them # # We only construct the new html pages if either +# * No HTML files exist yet # * .force exists in this directory (set by pdispatch when a log is # removed by package build success) # * A new log file has appeared since the last run. @@ -42,28 +43,25 @@ . ${pb}/${arch}/portbuild.conf -# create a name for the tempfile -of=.index.html - # get the list of buildlogs. cd ${buildlogdir} -if [ ! -e .stamp ]; then - exit +if [ -e .force -o \! -e index.html ]; then + rm -f .force + force=1 +else + force=0 fi alllogs=$(find . -maxdepth 1 -type f \( -name '*.log' -o -name '*.log.bz2' \) | sed -e 's,^./,,' 2>/dev/null) -if [ ${#alllogs} -eq 0 ]; then + +if [ -e .stamp -a ${#alllogs} -eq 0 ]; then exit fi -if [ -e .force ]; then - rm -f .force - force=1 -else - force=0 -fi +# create a name for the tempfile +of=.index.html # XXX temporary test -f .logs && rm -f .logs @@ -80,8 +78,6 @@ rm -f .logs/.all set -- ${alllogs} -# Total number of logs -num=0 gotnew=0 while [ $# -ge 1 ]; do @@ -105,7 +101,6 @@ gotnew=1 fi - num=$((num+1)) cat .logs/${base} >> .logs/.all done @@ -129,7 +124,7 @@ echo "| builddate " >>$of echo "]
" >>$of - if [ $num = "0" ]; then + if [ ${#alllogs} = "0" ]; then echo "No errors (yet)" >>$of else if [ -s cvsdone ]; then @@ -139,7 +134,7 @@ echo "Timestamp of newest log: $latest$num errors
" >> $of + echo "${#alllogs} errors
" >> $of echo "| Port | Aff. | Size | CVS | Maintainer | Reason | Build date | " +if [ ${#alllogs} -gt 0 ]; then sort .logs/.all | while read line; do IFS="|" set -- ${line} @@ -189,6 +185,7 @@ echo "" >> $of done +fi footer "" mv -f $of index.html @@ -198,6 +195,7 @@ # header "CVS | Aff. | Size | Port | Maintainer | Reason | Build date | " +if [ ${#alllogs} -gt 0 ]; then sort -t \| +4 .logs/.all | while read line; do IFS="|" set -- $line @@ -228,6 +226,7 @@ echo "" >> $of done +fi footer "" mv -f $of index-category.html @@ -237,6 +236,7 @@ # header "Maintainer | Port | Aff. | Size | CVS | Reason | Build date | " +if [ ${#alllogs} -gt 0 ]; then sort -t \| +5 .logs/.all | while read line; do IFS="|" set -- $line @@ -267,6 +267,7 @@ echo "" >> $of done +fi footer "" mv -f $of index-maintainer.html @@ -276,6 +277,7 @@ # header "Reason | Port | Aff. | Size | CVS | Maintainer | Build date | " +if [ ${#alllogs} -gt 0 ]; then sort -t \| +7 .logs/.all | while read line; do IFS="|" set -- ${line} @@ -306,6 +308,7 @@ echo "" >> $of done +fi footer "" mv -f $of index-reason.html @@ -315,6 +318,7 @@ # header "Build date | Port | Aff. | Size | CVS | Maintainer | Reason | " +if [ ${#alllogs} -gt 0 ]; then sort -t \| +9 .logs/.all | while read line; do IFS="|" set -- ${line} @@ -346,10 +350,17 @@ echo "" >> $of done +fi footer "" mv -f $of index-builddate.html # echo 'processlogs: at '`date`', create maintainer list' # # Get list of maintainers. -cut -f 6 -d \| .logs/.all | sort -fu > maintainers +if [ ${#alllogs} -gt 0 ]; then + cut -f 6 -d \| .logs/.all | sort -fu > maintainers +else + cat /dev/null > maintainers +fi + +# echo 'processlogs: at '`date`', done'
|---|