[Bio] / ReleaseTools / getpackage Repository:
ViewVC logotype

Diff of /ReleaseTools/getpackage

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2, Tue Dec 2 23:39:16 2003 UTC revision 1.4, Wed Dec 3 03:21:47 2003 UTC
# Line 36  Line 36 
36    
37     getHead=0     getHead=0
38     getTag=0     getTag=0
39       getAll=0
40       listAll=0
41     tagName=""     tagName=""
42    
43  #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
44  #++ process options  #++ process options
45    
46     set -- `getopt hr: $*`     set -- `getopt alhr: $*`
47     if [ $? = 0 ]; then     if [ $? = 0 ]; then
48         while [ $1 != -- ]         while [ $1 != -- ]
49           do           do
50           case $1 in           case $1 in
51               -h) getHead=1; getTag=0;;               -h) getHead=1; getTag=0;;
52               -r) getTag=1; getHead=0; tagName=$2; shift;;               -r) getTag=1; getHead=0; tagName=$2; shift;;
53                 -a) getAll=1;;
54                 -l) listAll=1;;
55           esac           esac
56           shift           shift
57         done         done
# Line 56  Line 60 
60    
61  #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
62  #++ check for correct number of arguments  #++ check for correct number of arguments
63     if [ "$#" -ne 1 ]; then  #
64         echo "One argument required"  # having trouble with [, so test is awkward:
65         echo "Usage: getpackage [-h | -r <releaseName>]  <PackageName>"  
66       if [ $getAll -eq 1 -o $listAll -eq 1 ]; then
67           if [ "$#" -ne 0 ]; then
68               echo "Usage: getpackage [-h | -r <tagName>]  <PackageName>"
69               echo "   or: getpackage [-a | -l ]"
70         exit 2         exit 2
71     fi     fi
72     packageName=$1     elif [ "$#" -ne 1 ]; then
73           echo "Usage: getpackage [-h | -r <tagName>]  <PackageName>"
74  #-----------------------------------------------------------------------         echo "   or: getpackage [-a | -l ]"
 #++ Makesure the package is not already checked out  
   
    if [ -r $packageName ]; then  
        echo $packageName already exists  
75         exit 2         exit 2
76       else
77           packageName=$1
78     fi     fi
79    
80    
81  #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
82  #++ Get package version from release  #++ Sanity check the release
 #-----------------------------------------------------------------------  
83    
84     if [ -z "$RTROOT" ]; then     if [ -z "$RTROOT" ]; then
85         echo "No RTROOT set"         echo "No RTROOT set"
# Line 87  Line 93 
93         exit 2         exit 2
94     fi     fi
95    
96     if [ ! -r "$baserel/$packageName" ]; then     packageVersionsFile="$baserel/PackageVersions"
97         echo Package $packageName not in the release  
98       if [ ! -r $packageVersionsFile ]; then
99           echo Release $baserel lacks a PackageVersions file
100         exit 2         exit 2
101     fi     fi
102    
103     if [ ! -r "$baserel/PackageVersions" ]; then  #-----------------------------------------------------------------------
104         echo Release $baserel lacks a PackageVersions file  #++ Easy cases first:  -l and -a
105    
106       if [ $listAll -eq 1 ] ; then
107           echo "Available packages in release $baserel:"
108           cat $packageVersionsFile
109           exit 0
110       fi
111    
112       if [ $getAll -eq 1 ] ; then
113           for pkg in `awk '{print $1 }' $packageVersionsFile` ; do
114               echo getting $pkg
115               $0 $pkg
116           done
117           exit 0
118       fi
119    
120    #-----------------------------------------------------------------------
121    #++ Makesure the package is not already checked out
122    
123       if [ -r $packageName ]; then
124           echo $packageName already exists
125           exit 2
126       fi
127    
128    #-----------------------------------------------------------------------
129    #++ Get package version from release
130    #-----------------------------------------------------------------------
131    
132       if [ ! -r "$baserel/$packageName" ]; then
133           echo Package $packageName not in the release
134         exit 2         exit 2
135     fi     fi
136    
137     packageVer=`grep $packageName $baserel/PackageVersions | awk '{print $2}'`     packageVer=`grep $packageName $packageVersionsFile | awk '{print $2}'`
138    
139     if [ -z "$packageVer" ]; then     if [ -z "$packageVer" ]; then
140         echo No version information for $packageName in $baserel/PackageVersions         echo No version information for $packageName in $packageVersionsFile
141         exit 2         exit 2
142     fi     fi
143    
# Line 118  Line 155 
155     fi     fi
156    
157  #-----------------------------------------------------------------------  #-----------------------------------------------------------------------
158  #++ Tune up the release area  #++ Tune up the release area.  The tmp directory per pkg is for putting temp
159    #   files made during build, e.g., .o files, lexx output.  The source
160    #   dir is read only (parallel builds on multiple architectures).
161    #   The per pkg dir under lib is to hold "compiled" python code and the like.
162    
163     mkdir tmp/$RTARCH/$packageName     mkdir tmp/$RTARCH/$packageName
164       mkdir lib/$RTARCH/$packageName
165    
166     exit 0     exit 0
167    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3