Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 122 lines (98 sloc) 3.11 KB
#!/bin/sh
########################################################################
# mkworkdir
#
# Makes a work area in which to check out packages, build, test, etc.
# This simply makes a directory, copies a top-level makefile into it from
# the release, and installs a set of directories and a config file assumbed
# by the build tools
#
# Usage:
# mkworkdir -r <releaseName> <workDirName>
#
# Assumes:
# RTROOT is set to point to the root of the release area. Releases
# live in $RTROOT/dist/releases
#
# History:
# 01 Dec 03 efrank First version. With thanks to Terry Hung and
# Bob Jacobsen (newrel in SoftRelTools. SLAC/LBL)
#
########################################################################
#++ params
# name of the package with release tools
releasetoolsname=ReleaseTools
#++ vars
baserelname=current
#-----------------------------------------------------------------------
#++ process options
set -- `getopt r: $*`
if [ $? = 0 ]; then
while [ $1 != -- ]
do
case $1 in
-r) baserelname=$2; shift;;
esac
shift
done
shift
fi
#-----------------------------------------------------------------------
#++ check for correct number of arguments
if [ "$#" -ne 1 ]; then
echo "One argument required"
echo "Usage: mkworkdir -r <releaseName> <workDirName>"
exit 2
fi
workdirname=$1
#-----------------------------------------------------------------------
#++ Makesure the work directory does not already exist
if [ -r $workdirname ]; then
echo $workdirname already exists
exit 2
fi
#-----------------------------------------------------------------------
#++ Find Base release
if [ -z "$RTROOT" ]; then
echo "No RTROOT set"
exit 2
fi
baserel=$RTROOT/dist/releases/$baserelname
if [ ! -r "$baserel" ]; then
echo "No such release: " $baserel
exit 2
fi
#-----------------------------------------------------------------------
#++ Make sure the ReleaseTools package is there (to get top level
# makefiles, etc.).
if [ ! -r "$baserel/$releasetoolsname" ]; then
echo "No $releasetoolsname" in the base release
exit 2
fi
releasetools=$baserel/$releasetoolsname
#-----------------------------------------------------------------------
#++ Make sure the top level makefile is there
if [ ! -r $releasetools/Makefile.top ]; then
echo "Invalid $releasetools: no top level makefile"
exit 2
fi
#-----------------------------------------------------------------------
#++ Make the directory structure
mkdir $workdirname
cd $workdirname
#mkdir bin
#mkdir bin/$RTARCH
#mkdir lib
#mkdir lib/$RTARCH
#mkdir tmp
#mkdir tmp/$RTARCH
#mkdir CGI
cp -p $releasetools/Makefile.top ./Makefile
echo "baserelname=$baserelname" > rtConfig
make installdirs
#-----------------------------------------------------------------------
#++ debug...delete real soon
echo "baserel : " $baserel
echo "baserelname : " $baserelname
echo "releasetools: " $releasetools
echo "workdirname : " $workdirname