~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/scripts/snapshot.csh

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/csh -fb
 
2
#
 
3
#___INFO__MARK_BEGIN__
 
4
##########################################################################
 
5
#
 
6
#  The Contents of this file are made available subject to the terms of
 
7
#  the Sun Industry Standards Source License Version 1.2
 
8
#
 
9
#  Sun Microsystems Inc., March, 2001
 
10
#
 
11
#
 
12
#  Sun Industry Standards Source License Version 1.2
 
13
#  =================================================
 
14
#  The contents of this file are subject to the Sun Industry Standards
 
15
#  Source License Version 1.2 (the "License"); You may not use this file
 
16
#  except in compliance with the License. You may obtain a copy of the
 
17
#  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
18
#
 
19
#  Software provided under this License is provided on an "AS IS" basis,
 
20
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
21
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
22
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
23
#  See the License for the specific provisions governing your rights and
 
24
#  obligations concerning the Software.
 
25
#
 
26
#  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
27
#
 
28
#  Copyright: 2001 by Sun Microsystems, Inc.
 
29
#
 
30
#  All Rights Reserved.
 
31
#
 
32
##########################################################################
 
33
#___INFO__MARK_END__
 
34
 
 
35
 
 
36
set TAG = HEAD
 
37
set CODIR = "/tmp/CODIR"
 
38
set OUTFILE = "/tmp/ge-HEAD-src.tar.gz"
 
39
set EXCLUDEFILES = "SGE5_3alpha.pdf"
 
40
set TAR = tar
 
41
 
 
42
#
 
43
# commandline parsing
 
44
#
 
45
while ($#argv >= 1)
 
46
   switch ("$argv[1]")
 
47
   case "-tag":
 
48
      set argv   = ($argv[2-])
 
49
      if ($#argv >= 1) then
 
50
         set TAG = $argv[1]
 
51
         set OUTFILE = "/tmp/ge-$TAG-src.tar.gz"
 
52
      else
 
53
         goto usage
 
54
         exit 1
 
55
      endif
 
56
      breaksw
 
57
   case "-o":
 
58
      set argv   = ($argv[2-])
 
59
      if ($#argv >= 1) then
 
60
         set OUTFILE = $argv[1]
 
61
      else
 
62
         goto usage
 
63
         exit 1
 
64
      endif
 
65
      breaksw
 
66
   case "-gtar":
 
67
      set TAR = gtar
 
68
      breaksw
 
69
   case "-w":
 
70
      set argv   = ($argv[2-])
 
71
      if ($#argv >= 1) then
 
72
         set CODIR = $argv[1]
 
73
      else
 
74
         goto usage
 
75
         exit 1
 
76
      endif
 
77
      breaksw
 
78
   case "-h":
 
79
   case "-help":
 
80
   case "--help":
 
81
      goto usage
 
82
      breaksw
 
83
   default:
 
84
      continue
 
85
      breaksw
 
86
   endsw
 
87
   set argv     = ($argv[2-])
 
88
end
 
89
 
 
90
#
 
91
# main
 
92
#
 
93
 
 
94
if ( ! -d $CODIR ) then
 
95
   mkdir -p $CODIR || exit 1
 
96
endif
 
97
 
 
98
if ( -f CVS/Root ) then
 
99
   setenv CVSROOT `cat CVS/Root`
 
100
endif
 
101
 
 
102
echo If the $CVSROOT is the wrong CVSROOT, press Ctrl-C
 
103
 
 
104
cd $CODIR || exit 1
 
105
rm -rf $CODIR/gridengine || exit 1
 
106
 
 
107
cvs -z9 -q co -r $TAG gridengine/source gridengine/INSTALL gridengine/Changelog gridengine/doc
 
108
find gridengine -name Root -exec rm {} \;
 
109
foreach i ( $EXCLUDEFILES ) 
 
110
   find gridengine -name $i -exec rm {} \;
 
111
end
 
112
rm -rf gridengine/doc/testsuite
 
113
rm -rf gridengine/source/experimental
 
114
 
 
115
 
 
116
$TAR cvzf $OUTFILE gridengine
 
117
if ( $status == 0 ) then
 
118
   rm -rf $CODIR/gridengine
 
119
else
 
120
   echo tar failed. Leaving $CODIR/gridengine unchanged
 
121
endif
 
122
 
 
123
exit 0
 
124
 
 
125
#
 
126
 
127
#
 
128
usage:
 
129
   echo "usage: <OPTIONS>"
 
130
 
 
131
   echo "OPTIONS are: "
 
132
   echo "-tag <tagname>   -> checkout tag instead of HEAD revision"
 
133
   echo "-o <file>        -> write to file <file> [default: $OUTFILE]"
 
134
   echo "-w <dir>         -> set checkout directory to <dir> [default: $CODIR]"
 
135
   echo "-gtar            -> use gtar as tar command"
 
136
   exit