[Bio] / ReleaseTools / getpackage Repository:
ViewVC logotype

View of /ReleaseTools/getpackage

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (annotate)
Tue Dec 2 23:39:16 2003 UTC (16 years, 2 months ago) by efrank
Branch: MAIN
Changes since 1.1: +6 -0 lines

Changes to support having RTARCH subdirs under lib, bin and tmp, e.g.,
bin/linux-postgres and tmp/lnux-postgres/MyPackage

#!/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
   tagName=""

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

   set -- `getopt hr: $*`
   if [ $? = 0 ]; then
       while [ $1 != -- ]
	 do
	 case $1 in
	     -h) getHead=1; getTag=0;;
	     -r) getTag=1; getHead=0; tagName=$2; shift;;
	 esac
	 shift
       done
       shift
   fi
   
#-----------------------------------------------------------------------
#++ check for correct number of arguments
   if [ "$#" -ne 1 ]; then
       echo "One argument required"
       echo "Usage: getpackage [-h | -r <releaseName>]  <PackageName>"
       exit 2
   fi
   packageName=$1
   
#-----------------------------------------------------------------------
#++ 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 [ -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

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

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

   packageVer=`grep $packageName $baserel/PackageVersions | awk '{print $2}'`

   if [ -z "$packageVer" ]; then
       echo No version information for $packageName in $baserel/PackageVersions
       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

   mkdir tmp/$RTARCH/$packageName

   exit 0
   

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3