blob: 373c1b814c4dabb75ac63c64b32f226100e0f000 [file] [log] [blame]
#!/bin/sh
#
# ptpbuild wrapper script
#
# Usage: ptpbuild [-t tag] [-d build_dir] [build_args]
#
# where
#
# tag is the CVS tag used to check out the releng project (default HEAD)
# build_dir is the location that the build will take place
# build_args are any arguments you want to pass to the build script
#
# set up anything environment specific that needs to be done before
# launching the build script in the releng project
LANG=en_US
TAG=HEAD
CDT_TAG=HEAD
# main staging directory
BUILD_DIR=/opt/public/download-staging.priv/tools/ptp/releng
args=`getopt c:d:t: $*`
if [ $? != 0 ]; then
echo "usage: ptpbuild [-t tag] [-c cdt_tag] [-d build_dir] [build_args]"
exit 1
fi
set -- $args
for i
do
case "$i"
in
-c) CDT_TAG="$2"; shift; shift;;
-d) BUILD_DIR="$2"; shift; shift;;
-t) TAG="$2"; shift; shift;;
--) shift; break;;
esac
done
BUILD_LOG=$BUILD_DIR/ptpbuild_${TAG}_`date +%Y%m%d%H%M`.log
touch $BUILD_LOG
chmod a+r $BUILD_LOG
{
# create the releng staging directory and go there
mkdir -p $BUILD_DIR && cd $BUILD_DIR
# remove the old build
rm -fr org.eclipse.ptp_${TAG}
# Check out the releng project
cvs -d /cvsroot/tools co -r $TAG -d org.eclipse.ptp_${TAG} org.eclipse.ptp/releng/org.eclipse.ptp.releng
# run the main script
cd org.eclipse.ptp_${TAG}
sh build.sh $*
} >$BUILD_LOG 2>&1
if grep -q 'BUILD FAILED' $BUILD_LOG; then
echo "BUILD FAILED. See $BUILD_LOG for details."
fi
exit 0