4 |
|
|
5 |
# download the source code and make a tar file |
# download the source code and make a tar file |
6 |
|
|
7 |
export CVSROOT=/u/gcmpack |
#export CVSROOT=/u/gcmpack |
8 |
|
#- to allow users to use cvs update/diff on their untar version of the code, |
9 |
|
# switch to pserver method (stored everywhere in the tree in dirs CVS/Root) |
10 |
|
export CVSROOT=':pserver:cvsanon@mitgcm.org:/u/gcmpack' |
11 |
|
|
12 |
umask 0002 |
umask 0002 |
13 |
|
|
14 |
echo 'Changing dir. to /u/httpd/html/download/daily_snapshot' |
echo 'Changing dir. to /u/httpd/html/download/daily_snapshot' |
15 |
cd /u/httpd/html/download/daily_snapshot |
cd /u/httpd/html/download/daily_snapshot |
16 |
|
outp=$? |
17 |
|
if test $outp != 0 ; then |
18 |
|
echo " Error in cd : $outp" |
19 |
|
exit |
20 |
|
fi |
21 |
test -e MITgcm && rm -rf MITgcm |
test -e MITgcm && rm -rf MITgcm |
22 |
|
|
23 |
echo 'Checking out MITgcm...' |
echo 'Checking out MITgcm...' |
24 |
cvs co -P MITgcm > /dev/null 2>&1 |
cvs co -P MITgcm > /dev/null |
25 |
#chgrp gcmpack MITgcm |
#chgrp gcmpack MITgcm |
26 |
#chmod 775 MITgcm |
#chmod 775 MITgcm |
27 |
|
|
34 |
|
|
35 |
echo 'Done!' |
echo 'Done!' |
36 |
|
|
37 |
|
#-- test for new checkpoint |
38 |
|
cd .. |
39 |
|
version_file="daily_snapshot/MITgcm/doc/tag-index" |
40 |
|
backupDir="other_checkpoints" |
41 |
|
if test -f $version_file ; then |
42 |
|
thischkpt=`awk '/^checkpoint/{print $1; exit}' $version_file` |
43 |
|
short=`echo $thischkpt | sed 's/checkpoint/c/'` |
44 |
|
chkptar="MITgcm_$short" |
45 |
|
if test -f $chkptar.tar.gz ; then |
46 |
|
echo "tar file ($chkptar) exist for current tag: $thischkpt" |
47 |
|
else |
48 |
|
echo -n "Checking out $thischkpt ..." |
49 |
|
rm -f checkout.out checkout.err |
50 |
|
cvs co -P -d $chkptar -r $thischkpt MITgcm 1> checkout.out 2> checkout.err |
51 |
|
outp=$? |
52 |
|
if test $outp != 0 ; then |
53 |
|
echo " Error in cvs checkout: $outp" |
54 |
|
cat checkout.err |
55 |
|
exit |
56 |
|
fi |
57 |
|
echo -n " ; making tar file ... " |
58 |
|
rm -f checkout.out checkout.err |
59 |
|
tar -cf $chkptar.tar $chkptar |
60 |
|
outp=$? |
61 |
|
if test $outp != 0 ; then |
62 |
|
echo " Error in tar command: $outp" |
63 |
|
exit |
64 |
|
else |
65 |
|
echo " Done" |
66 |
|
rm -r -f $chkptar |
67 |
|
fi |
68 |
|
gzip $chkptar.tar |
69 |
|
ls -l $chkptar.tar* |
70 |
|
#-- move previous tar file to backupDir |
71 |
|
listTar=`ls MITgcm_c*.tar.gz` |
72 |
|
if test -d $backupDir ; then |
73 |
|
for xx in $listTar ; do |
74 |
|
if test $xx != $chkptar.tar.gz ; then |
75 |
|
if test -f other_checkpoints/$xx ; then |
76 |
|
echo "error: $backupDir/$xx already exist" |
77 |
|
else |
78 |
|
echo " mv $xx $backupDir" |
79 |
|
mv $xx $backupDir |
80 |
|
fi |
81 |
|
fi |
82 |
|
done |
83 |
|
else |
84 |
|
echo " no dir: $backupDir" |
85 |
|
exit |
86 |
|
fi |
87 |
|
fi |
88 |
|
fi |
89 |
|
|