-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsave
executable file
·104 lines (83 loc) · 2.3 KB
/
save
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash -x
a=$1
b=$2
c=$3
web=$4
name_rep=/Users/lauvergn/trav/EVR-old
#current version
acur=`grep EVR version-EVR-T | awk '{print $3}'`
bcur=`grep Tnum version-EVR-T | awk '{print $3}'`
ccur=`grep Tana version-EVR-T | awk '{print $3}'`
name_sd="ElVibRot_f90-v"$acur"-Tnum"$bcur"-Tana"$ccur
name=$name_rep/$name_sd
echo curent version $acur $bcur $ccur
#new version
if test $a = "+"
then
echo with a+
a=`grep EVR version-EVR-T | awk '{print $3}' | awk -F. '{print $1 "." $2+1}'`
fi
if test $a = "0"
then
echo with a 0
a=$acur
fi
if test $b = "+"
then
echo with b+
b=`grep Tnum version-EVR-T | awk '{print $3}' | awk -F. '{print $1 "." $2+1}'`
fi
if test $b = "0"
then
echo with b 0
b=$bcur
fi
if test $c = "+"
then
echo with c+
c=`grep Tana version-EVR-T | awk '{print $3}' | awk -F. '{print $1 "." $2+1}'`
fi
if test $c = "0"
then
echo with c 0
c=$ccur
fi
#Save the current version
if test -s $name
then
echo The directory $name exists !!
exit
else
echo The repertoire $name does not exist
echo Copy the current EVRT version $acur
cp Source_ElVibRot/sub_main/EVR-T.f90 EVR-T.f90.i
LANG=C sed "s/printlevel = 1/printlevel = 0/" EVR-T.f90.i > Source_ElVibRot/sub_main/EVR-T.f90
rm EVR-T.f90.i
mkdir $name
cp -r * $name
cp makefile* version-EVR-T save trouv $name
cp -r Internal_data Source* sub_pot $name
cp -r Examples Working_tests $name
cp -r doc* EVR-doc* $name
cp -r scripts $name
mkdir $name/obj
#modify the version in version-EVR-T. It has to be done after the copy
echo Change the new version-EVR-T $a $b $c
echo "EVR = "$a > version-EVR-T
echo "Tnum = "$b >> version-EVR-T
echo "Tana = "$c >> version-EVR-T
cd $name
make clean
cd $name_rep
name_tar=E.$acur.$bcur.$ccur
echo $name_tar.tar
tar cvf $name_tar.tar $name_sd
gzip $name_tar.tar
#scp $name_tar.tar.gz styx2:/u/lauvergn/trav/ElVibRot-Tnum
scp $name_tar.tar.gz styx2:/userTMP/lauvergn/EVR
if test $web = "y"
then
echo save $name_tar.tar.gz on ElVibRot web page
ssh styx2 cp /userTMP/lauvergn/EVR/$name_tar.tar.gz /u/lauvergn/WWW/Pageperso/ElVibRot
fi
fi