From: Mark Huang Date: Fri, 21 May 2004 18:29:33 +0000 (+0000) Subject: - release build script X-Git-Tag: network-telescope-test-branch-point~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6a75b74fdf6ffa13b2cc68fbc29b9178419bdc52;p=build.git - release build script --- diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..5f600466 --- /dev/null +++ b/build.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# Release build script +# +# $Id: Makerules,v 1.7 2004/04/14 18:05:30 mlh-pl_rpm Exp $ +# + +# Set defaults +CVSROOT=pup-pl_rpm@cvs.planet-lab.org:/cvs +CVS_RSH=ssh +MODULE=rpm +TAG=HEAD + +# Get options +while getopts "d:r:" opt ; do + case $opt in + d) + CVSROOT=$OPTARG + ;; + r) + TAG=$OPTARG + ;; + *) + echo "usage: `basename $0` [-d $CVSROOT] [-r $TAG]" + ;; + esac +done + +# Create a unique build base +BASE=${TAG/HEAD/`date +%Y.%m.%d`} +i= +while ! mkdir ${BASE}${i} 2>/dev/null ; do + [ -z ${i} ] && BASE=${BASE}. + i=$((${i}+1)) + if [ $i -gt 100 ] ; then + echo "$0: Failed to create release directory `pwd`/${BASE}${i}" + exit 1 + fi +done +BASE=${BASE}${i} + +# Redirect both stdout and stderr to log file +exec &>${BASE}/log + +# Build +cvs -d ${CVSROOT} export -r ${TAG} -d ${BASE} ${MODULE} +make -C ${BASE}