[Bio] / ReleaseTools / importrel Repository:
ViewVC logotype

Diff of /ReleaseTools/importrel

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

revision 1.1, Mon Dec 1 15:16:53 2003 UTC revision 1.2, Mon Dec 22 21:38:03 2003 UTC
# Line 1  Line 1 
1  #  #!/bin/sh
2    
3    ########################################################################
4  #  #
5  # Imports a relase from a peer into the release area.  Options:  # Imports a relase from a peer into the release area.  Options:
6  #  #
7  #   o importrel URL/<releaseName>        One possibility  # Usage:
8  #   o importrel <releaseName>            Knows a default host.  #    importrel -r <releaseName> -h <hostname>
9  #   o importrel user@host:releaseName    ssh-ish  #
10    #    Finds <releaseName> in release area of <hostname> and copies into
11    #    our release area.
12    #
13    #    Names should jsut be names like 0.2.3, not full paths
14    #
15    # ASSUMES:
16    #     Assumes you can ssh to the host
17    #
18    #
19    # History:
20    #    23 Dec 03 efrank    first version
21    #
22    # BUGS:
23    #
24    ########################################################################
25    
26    
27    #-----------------------------------------------------------------------
28    #++ vars
29    
30    newReleaseName=""
31    hostName=""
32    
33    
34    #-----------------------------------------------------------------------
35    #++ process options
36    
37       set -- `getopt r:h: $*`
38       if [ $? = 0 ]; then
39           while [ $1 != -- ]
40             do
41             case $1 in
42                 -r) newReleaseName=$2; shift;;
43                 -h) hostName=$2; shift;;
44             esac
45             shift
46           done
47           shift
48       fi
49    
50    
51    #-----------------------------------------------------------------------
52    #++ check for correct number of arguments
53  #  #
54       if [ "$#" -ne 0 ]; then
55           echo "Usage: importrel -r <releaseName> -h <hostname>"
56           exit 2
57       fi
58    
59       echo $newReleaseName
60       echo $hostName
61    
62       if [ x$newReleaseName = "x" ]; then
63           echo "You must give a release name"
64           exit 2
65       fi
66    
67       if [ x$hostName = "x" ]; then
68           echo "You must give a hostname"
69           exit 2
70       fi
71    
72    #-----------------------------------------------------------------------
73    #++ Sanity check the release
74    
75       if [ -z "$RTROOT" ]; then
76           echo "No RTROOT set"
77           exit 2
78       fi
79    
80       releaseArea=$RTROOT/dist/releases
81    
82       if [ ! -r "$releaseArea" ]; then
83           echo "No release Areas: " $releaseArea
84           exit 2
85       fi
86    
87       newRelease=$releaseArea/$newReleaseName
88    
89       if [ -r $newRelease ]; then
90           echo "Release $newReleaseName already exists in release area, $releaseArea"
91           exit 2
92       fi
93    
94    #-----------------------------------------------------------------------
95    #++ OK, copy it over.
96    
97       # Warp us there, Mr. Sulu
98    
99       cd $releaseArea
100       ssh $hostName "(cd \$RTROOT/dist/releases; tar czf - $newReleaseName)" | tar xzf -
101    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3