#!/bin/bash
export LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql
# =============================================================
# onfail usage:
#
# $1 = top (src directory)
# $2 = type (current type from build server)
# $3 = title
# $4 = buildnumber
# =============================================================
export TOP=$1
export TYPE=$2
export TITLE=$3
export NUM=$4
export BUILD_DIR=/mnt/dev/builds
export BLDSVRDIR=$HOME/buildserver/server
export RTL=/mnt/dev/builds/$TITLE/$NUM
export SHARED_DIR=$BLDSVRDIR/jobs/shared
cd $TOP
perl -I$BLDSVRDIR/lib $SHARED_DIR/gentoc.pl -f $RTL/bldcontents.html -n $TITLE
if [ ! -d $BUILD_DIR/$3/$4 ]
then
mkdir -p $BUILD_DIR/$3/$4
fi
perl -I$BLDSVRDIR/lib $SHARED_DIR/log2html.pl -e $HOME/buildserver/server/config/$TITLE.errors -i $TOP/$TITLE.retail.log -o $RTL/build_log.html
perl -I$BLDSVRDIR/lib $SHARED_DIR/buildfuncs.pl removegenerated $TITLE &
perl -I$BLDSVRDIR/lib $SHARED_DIR/getlogs.pl slcdev28 $TITLE $NUM &
perl -I$BLDSVRDIR/lib $SHARED_DIR/buildfuncs.pl removecomments
rm -f $TOP/cmspackage/_taskdir/*