[Bio] / ReleaseTools / newrel Repository:
ViewVC logotype

View of /ReleaseTools/newrel

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (annotate)
Fri Mar 26 19:46:26 2004 UTC (15 years, 8 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-09, mobedac_release_05302012, V00-00-10, rast_rel_2010_0928, 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, 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: +1 -1 lines
xeq bit

#!/bin/sh

########################################################################
# Given a definition, creates a new release.  Eventually, we want 
# something more sophisticated, but for now we just read a file
# that defines all the packages to include in the release, along with
# tag names.  An example of more sophisticated would be to help the
# user form that file by looking at a test release and the underlying
# release it is based upon.
#
# Usage:
#    newrel <releaseName> -f <PackageVersionsFileName>
#        makes new dir called <releaseName> in release area, copies
#        the PackageVersionsFile there and fills the directory
#        with packages as specified.
#
#        Note, <releaseName> is just name, e.g., 1.2.3. No path.
#
# PackageVersions is a list of
#  <PackageName> <version>
# e.g.,
#   ReleaseTools V00-00-05
#   FigCommon V00-00-01
#   FigKernelPackages V00-00-02
#   FigKernelScripts V00-00-01
#   FigPeer2PeerTools V00-00-00
#   FigWebPages V00-00-00
#   FigWebServices V00-00-02
########################################################################


#-----------------------------------------------------------------------
#++ vars

releaseArea=""                     # $RTROOT/dist/releases, if RTROOT set
packageVersionsFileName=""         # Command arg from user. 
newReleaseName=""                  # Command arg passed by user.
newReleasePathAndName=""           # $releaseArea/$newReleaseName 
invokedFromDir=`pwd`


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

   set -- `getopt f: $*`
   if [ $? = 0 ]; then
       while [ $1 != -- ]
	 do
	 case $1 in
	     -f) packageVersionsFileName=$2; shift;;
	 esac
	 shift
       done
       shift
   fi
   

#-----------------------------------------------------------------------
#++ check for correct number of arguments
#
   if [ "$#" -ne 1 ]; then
       echo "Usage: newrel <releaseName> -f <PackageVersionsFileName>"
       exit 2
   fi
   newReleaseName=$1

   echo "Add code to enforce naming rules for release name...should be form i.j.k"
   echo

   if [ $packageVersionsFileName = "" ]; then
       echo "You must give a PackageVersions file name via -f "
       exit 2
   fi

#-----------------------------------------------------------------------
# ++ Does the PackageVersionsFile exist?

   if [ ! -r $packageVersionsFileName ]; then 
       echo "PackageVersionsFile $packageVersionsFileName not readable"
       exit 2
   fi
 

#-----------------------------------------------------------------------
#++ Validate format of PackageVersions
#   Require all packages have tag names.  None are HEAD

   echo "Add code to Validate format of PackageVersions.  Require all packages have tag names.  None are HEAD"
   echo

#-----------------------------------------------------------------------
#++ Sanity check the release

   if [ -z "$RTROOT" ]; then
       echo "No RTROOT set"
       exit 2
   fi

   releaseArea=$RTROOT/dist/releases

   if [ ! -r "$releaseArea" ]; then
       echo "No release Areas: " $releaseArea
       exit 2
   fi

   newReleasePathAndName=$releaseArea/$newReleaseName 

   if [ -r $newReleasePathAndName ]; then
       echo "Release $newReleaseName already exists in release area, $releaseArea"
       exit 2
   fi

#-----------------------------------------------------------------------
#++ OK, make the new release directory and put config file there
#   and PackageVersions file 

   # Don't know how PackageVersions file was specified to us.  Could be
   # absolute path or not.  Just remember where we are so we can do the
   # copy, below

   invokedFromDir=`pwd`
 
   # Warp us there, Mr. Sulu

   cd $releaseArea
   mkdir $newReleaseName

   if [ ! -r $newReleaseName ]; then
       echo "Failed to make new release directory"
       exit 2
   fi
   
   cd $newReleaseName

   # put in a rgConfig that points to ourselves.  This will let us
   # call other ReleaseTools tools to help us build this thing.

   echo "baserelname=$newReleaseName" > rtConfig

   if [ ! -r  rtConfig ]; then
       echo "Failed to make rtConfig file...you clean up the mess"
       exit 2
   fi

   # copy in the PackageVersions file.  Note that we make sure it
   # goes in with the right name, "PackageVersions"

   cd $invokedFromDir
   cp -p $packageVersionsFileName $newReleasePathAndName/PackageVersions

   installedPackageVersionsFile=$newReleasePathAndName/PackageVersions

   cd $newReleasePathAndName

#-----------------------------------------------------------------------
#++ Load it with the packages.

   # this uses the PackageVersions we just dumped in

   cd $newReleasePathAndName
   for pkg in `awk '{print $1 }' $installedPackageVersionsFile` ; do
       echo getting $pkg
       packageVer=`grep $pkg $installedPackageVersionsFile | awk '{print $2}'`
       echo cvs co  -r $packageVer  $pkg
       cvs co  -r $packageVer  $pkg
   done

#-----------------------------------------------------------------------
#++ Now that we have the packages, make the directory structure for
#  the release. We do that by deferring to the makefile in ReleaseTools.
#  Since the version of ReleaseTools can change release to release, we
#  use the info in the PackageVersions file we were called with.

   cd $newReleasePathAndName
   if [ -r ReleaseTools ]; then
       cp -p ReleaseTools/Makefile.top Makefile
       make installdirs
   else
       echo "WARNING: No ReleaseTools in PackageVersions.  You're going to regret it...continuing anyway."
   fi


#-----------------------------------------------------------------------
#++ Zorch all the CVS directories.

   cd $newReleasePathAndName

   # brain fade...can't get -exec to work for me and am in rush:

   rm -rf `find . -type d -name CVS -print`

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3