[Bio] / ReleaseTools / mkworkdir Repository:
ViewVC logotype

View of /ReleaseTools/mkworkdir

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (annotate)
Mon Dec 1 15:16:53 2003 UTC (16 years, 4 months ago) by efrank
Branch: MAIN
Branch point for: orig
Initial revision

#!/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 ]; then
       echo "Invalid $releasetools: no top level makefile"
       exit 2
   fi

#-----------------------------------------------------------------------
#++ Make the directory structure

   mkdir $workdirname
   cd $workdirname
   mkdir bin
   mkdir lib
   cp -p $releasetools/Makefile .
   echo "baserelname=$baserelname" > rtConfig

#-----------------------------------------------------------------------
#++ debug...delete real soon

   echo "baserel     : "  $baserel
   echo "baserelname : "  $baserelname
   echo "releasetools: "  $releasetools 
   echo "workdirname : "  $workdirname

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3