1 | #!/bin/bash |
---|
2 | # fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
3 | # add g option in ?format=raw sed transformation in order to fix |
---|
4 | # link on top of idldoc like directory-overview.html |
---|
5 | # fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
6 | # add ?format=raw in idldoc production for frames |
---|
7 | # fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
8 | # add action for idldochtml |
---|
9 | # fplod 2006-06-02T14:28:30Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
10 | # modification to produce tar files in /tmp/saxo_${$} when dotar=1 |
---|
11 | # modification to copy tar files on http://forge.ipsl.jussieu.fr/saxo/download/ |
---|
12 | # when doforge=1 |
---|
13 | # produce tar files in /tmp/saxo_${$} when dotar=1 |
---|
14 | set -x |
---|
15 | set -u |
---|
16 | # |
---|
17 | dohtml=0 |
---|
18 | dooldtest=0 |
---|
19 | doidldoc_html=1 |
---|
20 | doidldoc_assistant=0 |
---|
21 | doidlwavedoc=0 |
---|
22 | doTARsrc=0 |
---|
23 | doTARdata=0 |
---|
24 | doforge=0 |
---|
25 | doSRClodyc=0 |
---|
26 | doDTAlodyc=0 |
---|
27 | doSRCidris=1 |
---|
28 | doDTAidris=1 |
---|
29 | # |
---|
30 | # |
---|
31 | # get the date in a nice format |
---|
32 | # |
---|
33 | ndate=`date +%Y%m%d` |
---|
34 | # memorize current directory |
---|
35 | memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc |
---|
36 | #------------------------------------------------------------------ |
---|
37 | if [ ${dohtml} -eq 1 ] |
---|
38 | then |
---|
39 | # |
---|
40 | # redo the html file |
---|
41 | # |
---|
42 | cd ${memopwd} |
---|
43 | for docxml in firststeps.xml getsaxo.xml mailing.xml main.xml tiplink.xml updatesaxo.xml whatissaxo.xml whatsnew.xml |
---|
44 | do |
---|
45 | ./makehtml.sh $(basename ${docxml} .xml) |
---|
46 | # tidy -m $(basename ${docxml}).html |
---|
47 | done |
---|
48 | exit 0 |
---|
49 | fi |
---|
50 | #------------------------------------------------------------------ |
---|
51 | if [ ${dooldtest} -eq 1 ] |
---|
52 | then |
---|
53 | # make the old test |
---|
54 | # |
---|
55 | cd ${memopwd}/../../Tests/ |
---|
56 | ./makeold.sh |
---|
57 | exit 0 |
---|
58 | fi |
---|
59 | #------------------------------------------------------------------ |
---|
60 | if [ ${doidlwavedoc} -eq 1 ] |
---|
61 | then |
---|
62 | # |
---|
63 | # redo idlwave doc |
---|
64 | # |
---|
65 | cd ${memopwd}/../ |
---|
66 | Documentation/idlwave_catalog -v -f saxo |
---|
67 | exit 0 |
---|
68 | fi |
---|
69 | #------------------------------------------------------------------ |
---|
70 | if [ ${doidldoc_html} -eq 1 ] |
---|
71 | then |
---|
72 | # |
---|
73 | # build a idl file to launch idldoc |
---|
74 | cat <<EOF > /tmp/idldoc_html_${$}.pro |
---|
75 | !path = expand_path('+' + '../idldoc/') |
---|
76 | print,!path |
---|
77 | idldoc,root="../../",LOG_FILE="/tmp/idldochtlm_${$}.log", $ |
---|
78 | output="../idldoc_html_output",/preformat |
---|
79 | exit |
---|
80 | EOF |
---|
81 | # launch idl with the file built above |
---|
82 | IDL_STARTUP=/tmp/idldoc_html_${$}.pro;idl |
---|
83 | /bin/rm /tmp/idldoc_html_${$}.pro |
---|
84 | # In order to do not have to many revision in svn, we modify some |
---|
85 | # lines produced by idldoc : |
---|
86 | # examples : |
---|
87 | # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> |
---|
88 | # will be replaced by |
---|
89 | # <!-- Generated by IDLdoc 2.0 --> |
---|
90 | # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun 7 10:54:37 2006.</div |
---|
91 | # will be replaced by |
---|
92 | # <div id="tagline">Produced by IDLdoc 2.0</div> |
---|
93 | # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> |
---|
94 | # will be delete |
---|
95 | # other lines will be deleted because the time is the time of checkout not |
---|
96 | # the time of revision. |
---|
97 | # the sequence of lines |
---|
98 | #<dl> |
---|
99 | # <dt>Last modification:</dt> |
---|
100 | # <dd>Fri Jun 2 11:46:24 2006</dd> |
---|
101 | # </dl> |
---|
102 | # should also be removed ++ je ne sais pas dire en sed la ligne |
---|
103 | # suivant l'occurence de Last modification |
---|
104 | # add ?format=rawx to links on html files |
---|
105 | list_html=$(find ../idldoc_html_output/ -name "*.html") |
---|
106 | for file_html in ${list_html} |
---|
107 | do |
---|
108 | sed \ |
---|
109 | -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ |
---|
110 | -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \ |
---|
111 | -e "/<h2>Produced on/d" \ |
---|
112 | -e "/Last modification:/d" \ |
---|
113 | -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ |
---|
114 | -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \ |
---|
115 | -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \ |
---|
116 | -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \ |
---|
117 | ${file_html} > ${file_html}_modify |
---|
118 | mv ${file_html}_modify ${file_html} |
---|
119 | done |
---|
120 | echo "iii : you can see log file in /tmp/idldochtlm_${$}.log" |
---|
121 | echo "iii : and look ../idldoc_html_output/idldoc-warnings.html#undoc" |
---|
122 | exit 1 |
---|
123 | fi |
---|
124 | #------------------------------------------------------------------ |
---|
125 | if [ ${doidldoc_assistant} -eq 1 ] |
---|
126 | then |
---|
127 | # |
---|
128 | echo "eee : pas encore ecrit" |
---|
129 | exit 1 |
---|
130 | fi |
---|
131 | #------------------------------------------------------------------ |
---|
132 | if [ ${doTARsrc} -eq 1 ] |
---|
133 | then |
---|
134 | localtarbase=/tmp/savesaxo_${$} |
---|
135 | mkdir ${localtarbase}/ |
---|
136 | # clean backup files : *~ |
---|
137 | find ${memopwd}/../../.. -name "*~" -exec rm {} \; |
---|
138 | # prepare the source tar (without the svn...) |
---|
139 | # |
---|
140 | cd ${memopwd}/../../.. |
---|
141 | tar czf ${localtarbase}/SAXO_SRC_${ndate}.tar.gz --exclude .svn SRC |
---|
142 | # |
---|
143 | # informations |
---|
144 | echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" |
---|
145 | ls -l ${localtarbase} |
---|
146 | fi |
---|
147 | #------------------------------------------------------------------ |
---|
148 | if [ ${doTARdata} -eq 1 ] |
---|
149 | then |
---|
150 | localtarbase=/tmp/savesaxo_${$} |
---|
151 | mkdir ${localtarbase}/ |
---|
152 | # |
---|
153 | # prepare the data tar (without the svn...) |
---|
154 | # |
---|
155 | cd ${memopwd}/../../.. |
---|
156 | tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz --exclude .svn DATA |
---|
157 | # |
---|
158 | # informations |
---|
159 | echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" |
---|
160 | ls -l ${localtarbase} |
---|
161 | fi |
---|
162 | #------------------------------------------------------------------ |
---|
163 | if [ ${doforge} -eq 1 ] |
---|
164 | then |
---|
165 | echo "iii : you will be asked saxo@forge.ipsl.jussieu.fr passwd two times" |
---|
166 | if [ ${doTARsrc} -ne 1 ] |
---|
167 | then |
---|
168 | localtarbase=${1} |
---|
169 | fi |
---|
170 | scp ${localtarbase}/SAXO_*.tar.gz saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ |
---|
171 | echo "iii : do not forget to update getsaxo.html" |
---|
172 | echo "iii : \$ ./makehtml.sh getsaxo" |
---|
173 | echo "iii : do not forget to clean ${localtarbase}" |
---|
174 | fi |
---|
175 | #------------------------------------------------------------------ |
---|
176 | if [[ ($doSRClodyc -eq 1) || ($doDTAidris -eq 1) ]] |
---|
177 | then |
---|
178 | infosrc=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
179 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
180 | filesrc=$( basename $filesrc ) |
---|
181 | [ $doSRClodyc -eq 1 ] && rshell=bash || rshell=ksh |
---|
182 | # |
---|
183 | cat <<EOF > job_src_$$ |
---|
184 | #!/bin/${rshell} |
---|
185 | cd SAXO_DIR |
---|
186 | # |
---|
187 | rm -rf SRC |
---|
188 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc |
---|
189 | gunzip $filesrc |
---|
190 | tar vxf $( basename $filesrc .gz ) |
---|
191 | rm -f $( basename $filesrc .gz ) |
---|
192 | # |
---|
193 | chmod -R 755 * |
---|
194 | exit |
---|
195 | # |
---|
196 | EOF |
---|
197 | fi |
---|
198 | # |
---|
199 | if [[ ($doDTAlodyc -eq 1) || ($doDTAidris -eq 1) ]] |
---|
200 | then |
---|
201 | infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
202 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
203 | filedata=$(basename $filedata) |
---|
204 | [ $doDTAlodyc -eq 1 ] && rshell=bash || rshell=ksh |
---|
205 | cat <<EOF > job_data_$$ |
---|
206 | #!/bin/${rshell} |
---|
207 | cd SAXO_DIR |
---|
208 | # |
---|
209 | rm -rf DATA |
---|
210 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata |
---|
211 | gunzip $filedata |
---|
212 | tar vxf $( basename $filedata .gz ) |
---|
213 | rm -f $( basename $filedata .gz ) |
---|
214 | # |
---|
215 | chmod -R 755 * |
---|
216 | exit |
---|
217 | # |
---|
218 | EOF |
---|
219 | fi |
---|
220 | #------------------------------------------------------------------ |
---|
221 | if [ $doSRClodyc -eq 1 ] |
---|
222 | then |
---|
223 | # update src on cerbere |
---|
224 | # |
---|
225 | echo "iii : update src on cerbere cerbere" |
---|
226 | scp job_src_$$ smasson@cerbere.lodyc.jussieu.fr:. |
---|
227 | ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$" |
---|
228 | fi |
---|
229 | #------------------------------------------------------------------ |
---|
230 | if [ $doDTAlodyc -eq 1 ] |
---|
231 | then |
---|
232 | # update data on cerbere |
---|
233 | echo "iii : update data on cerbere" |
---|
234 | scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:. |
---|
235 | ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" |
---|
236 | fi |
---|
237 | #------------------------------------------------------------------ |
---|
238 | if [ $doSRCidris -eq 1 ] |
---|
239 | then |
---|
240 | # update src on rhodes |
---|
241 | echo "iii : update src to rhodes" |
---|
242 | scp job_src_$$ reee217@rhodes.idris.fr:. |
---|
243 | ssh reee217@rhodes.idris.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$" |
---|
244 | fi |
---|
245 | #------------------------------------------------------------------ |
---|
246 | if [ $doDTAidris -eq 1 ] |
---|
247 | then |
---|
248 | # update data on gaya |
---|
249 | echo "iii : update data to gaya" |
---|
250 | scp job_data_$$ reee217@gaya.idris.fr:. |
---|
251 | ssh reee217@gaya.idris.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" |
---|
252 | fi |
---|
253 | #------------------------------------------------------------------ |
---|
254 | # |
---|
255 | [ -f job_src_$$ ] && rm -f job_src_$$ |
---|
256 | [ -f job_data_$$ ] && rm -f |
---|
257 | # |
---|
258 | exit |
---|
259 | # |
---|