[Bio] / ReleaseTools / getpackage Repository:
ViewVC logotype

View of /ReleaseTools/getpackage

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (annotate)
Wed Dec 3 03:21:47 2003 UTC (15 years, 10 months ago) by efrank
Branch: MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, rast_rel_2014_0912, rast_rel_2008_06_18, rast_rel_2008_06_16, mgrast_dev_04082011, Root-bobdev_news, merge-trunktag-bobdev_news-2, merge-trunktag-bobdev_news-1, rast_rel_2009_05_18, rast_rel_2009_0925, rast_rel_2010_0118, preTreatmanDyn, merge-trunktag-bodev_news-3, rast_rel_2009_02_05, rast_rel_2011_0119, rast_rel_2008_12_18, rast_rel_2008_10_09, rast_release_2008_09_29, mgrast_rel_2008_0919, rast_rel_2009_07_09, rast_rel_2011_0928, mgrast_rel_2008_0917, mgrast_dev_04052011, sc04-finalDay, merge-bodev_news-3, V00-00-05, V00-00-07, V00-00-06, V00-00-09, mobedac_release_05302012, V00-00-10, rast_rel_2010_0928, delong-02, mgrast_version_3_2, gunk, caBIG-05Apr06-00, mgrast_dev_02212011, preSchematools, mgrast_rel_2008_0625, V00-00-12, V00-00-13, mgrast_release_3_0_4, V00-00-11, mgrast_release_3_0_2, mgrast_release_3_0_3, V00-00-14, V00-00-15, merge-bobdev_news-2, merge-bobdev_news-1, mgrast_dev_05262011, mgrast_rel_2008_0806, rast_rel_2008_08_07, myrast_33, rast_rel_2008_09_29, mgrast_dev_02222011, stMigration0, mgrast_dev_10262011, rast_rel_2008_11_24, sc2004-4, sc2004-3, sc2004-2, sc2004-1, sc2004-0, mgrast_dev_06072011, rast_rel_2008_09_30, before-dynamics-persistence, rast_rel_2008_10_29, rast_rel_2014_0729, mgrast_dev_03252011, mgrast_release_3_0, rast_rel_2010_1206, mgrast_rel_2008_0924, V00-00-08, lwc, mass-spec-01, mgrast_dev_03312011, mass-spec-03, mass-spec-02, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, makeScriptHeaders, rast_rel_2008_07_21, mgrast_rel_2008_0923, mgrast_release_3_0_1, rast_rel_2010_0827, rast_rel_2009_03_26, rast_2008_0924, mgrast_dev_12152011, rast_rel_2010_0526, forRick-14Jul04-0, rast_rel_2008_04_23, caBIG-00-00-00, delong-01, post-st-migration2, mgrast_rel_2008_1110_v2, mgrast_dev_04012011, treatman-lastDay-0, forRick-14Jul04-1, mgrast_rel_2008_1110, post-st-migration, caBIG-13Feb06-00, HEAD
Branch point for: Branch-bobdev_news
Changes since 1.3: +57 -20 lines

add -a and -l

-l lists all available packages
-a checks out all available packages

#!/bin/sh
########################################################################
#
# getpackage
#
# Used when inside a work directory.  Figures out the correct version of
# a package for the underlying base release and checks it out from CVS.
# It may make modifications to lib/ or other directories to make ready
# for the release tools (but I hope not).
#
# getpackage is NOT a wrapper over cvs.
#
# Usage:
#   1. cd to your work directory
#   2. getpackage <packageName>
#
# Options
#    -h        get the HEAD of CVS
#    -r  TAG   get the specificed tag
#
# Assumes:
#   o cvs in path
########################################################################

#-----------------------------------------------------------------------
#++ Sanity check: are we in a test release?

   if [ ! -r rtConfig ]; then
       echo Use from a work directory made by mkworkdir
       exit 2
   fi

#-----------------------------------------------------------------------
#++ vars
   source rtConfig
   
   getHead=0
   getTag=0
   getAll=0
   listAll=0
   tagName=""

#-----------------------------------------------------------------------
#++ process options

   set -- `getopt alhr: $*`
   if [ $? = 0 ]; then
       while [ $1 != -- ]
	 do
	 case $1 in
	     -h) getHead=1; getTag=0;;
	     -r) getTag=1; getHead=0; tagName=$2; shift;;
	     -a) getAll=1;;
	     -l) listAll=1;;
	 esac
	 shift
       done
       shift
   fi
   
#-----------------------------------------------------------------------
#++ check for correct number of arguments
#
# having trouble with [, so test is awkward:

   if [ $getAll -eq 1 -o $listAll -eq 1 ]; then
       if [ "$#" -ne 0 ]; then
	   echo "Usage: getpackage [-h | -r <tagName>]  <PackageName>"
	   echo "   or: getpackage [-a | -l ]"
	   exit 2
       fi
   elif [ "$#" -ne 1 ]; then
       echo "Usage: getpackage [-h | -r <tagName>]  <PackageName>"
       echo "   or: getpackage [-a | -l ]"
       exit 2
   else
       packageName=$1
   fi
   

#-----------------------------------------------------------------------
#++ Sanity check the 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

   packageVersionsFile="$baserel/PackageVersions"

   if [ ! -r $packageVersionsFile ]; then
       echo Release $baserel lacks a PackageVersions file
       exit 2
   fi

#-----------------------------------------------------------------------
#++ Easy cases first:  -l and -a

   if [ $listAll -eq 1 ] ; then
       echo "Available packages in release $baserel:"
       cat $packageVersionsFile
       exit 0
   fi

   if [ $getAll -eq 1 ] ; then
       for pkg in `awk '{print $1 }' $packageVersionsFile` ; do
	   echo getting $pkg
	   $0 $pkg
       done
       exit 0
   fi

#-----------------------------------------------------------------------
#++ Makesure the package is not already checked out
   
   if [ -r $packageName ]; then
       echo $packageName already exists
       exit 2
   fi

#-----------------------------------------------------------------------
#++ Get package version from release
#-----------------------------------------------------------------------

   if [ ! -r "$baserel/$packageName" ]; then
       echo Package $packageName not in the release
       exit 2
   fi

   packageVer=`grep $packageName $packageVersionsFile | awk '{print $2}'`

   if [ -z "$packageVer" ]; then
       echo No version information for $packageName in $packageVersionsFile
       exit 2
   fi

#-----------------------------------------------------------------------
#++ Get package if HEAD or TAG
   
   if [ $getTag -eq 1 ]; then
       echo overriding release version $packageVer with tag $tagName
       cvs co  -r $tagName $packageName
   elif [ $getHead -eq 1 ]; then
       echo echo overriding release version $packageVer with HEAD of CVS
       cvs co  -r HEAD $packageName
   else
       cvs co  -r $packageVer  $packageName
   fi
 
#-----------------------------------------------------------------------
#++ Tune up the release area.  The tmp directory per pkg is for putting temp
#   files made during build, e.g., .o files, lexx output.  The source
#   dir is read only (parallel builds on multiple architectures).
#   The per pkg dir under lib is to hold "compiled" python code and the like.

   mkdir tmp/$RTARCH/$packageName
   mkdir lib/$RTARCH/$packageName

   exit 0
   

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3