#!/bin/sh
OUTDIR=$1
ARCH=$2
RESULTS=$3
OUTFILE=$OUTDIR/$ARCH/HEADER.html
grep -q WARNING $OUTFILE
if [ $? -ne 0 ] ; then
echo >> $OUTFILE
echo "
WARNING:" >> $OUTFILE
echo "This build is not up to date; it is the most recent successful build.
" >> $OUTFILE
echo >> $OUTFILE
echo "Later weekly builds failed with errors:
" >> $OUTFILE
fi
echo "
" >> $OUTFILE
echo "" >> $OUTFILE
for RESULT in $RESULTS; do
TYPE=`echo $RESULT | awk -F / '{print $1}'`
ERROR=`echo $RESULT | awk -F / '{print $2}'`
DATE=`echo $RESULT | awk -F / '{print $3}'`
case $TYPE in
CDFAIL)
echo "- Full CD build failed with error $ERROR at $DATE" >> $OUTFILE ;;
DVDFAIL)
echo "
- DVD build failed with error $ERROR at $DATE" >> $OUTFILE ;;
BDFAIL)
echo "
- Blu-ray build failed with error $ERROR at $DATE" >> $OUTFILE ;;
KDECDFAIL)
echo "
- KDE CD build failed with error $ERROR at $DATE" >> $OUTFILE ;;
LIGHTCDFAIL)
echo "
- XFCE/lxde CD build failed with error $ERROR at $DATE" >> $OUTFILE ;;
esac
done
echo "
" >> $OUTFILE