1 | #!/bin/bash |
---|
2 | # |
---|
3 | # update : |
---|
4 | # $Id$ |
---|
5 | # fplod 2006-09-18T13:25:12Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
6 | # add status checking after makehtml.sh |
---|
7 | # smasson Fri Sep 15 10:42:01 CEST 2006 |
---|
8 | # merge idldoc html and idldoc assistant |
---|
9 | # smasson Thu Sep 14 15:19:23 CEST 2006 |
---|
10 | # add the revision number in the name of SAXO_SRC_*.tar.gz |
---|
11 | # smasson Wed Sep 13 14:18:02 CEST 2006 |
---|
12 | # add the directory-overview.html from dir-files.html in idldoc_html_output |
---|
13 | # fplod 2006-09-07T08:09:47Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
14 | # main is rename to websaxo |
---|
15 | # fplod 2006-09-05T15:39:47Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
16 | # add Source link in idldoc html outpout |
---|
17 | # snlod/fplod 2006-08-25T08:30:36Z electre.locean-ipsl.upmc.fr (Darwin) |
---|
18 | # add for idldoc assistant |
---|
19 | # fplod 2006-08-17T09:19:06Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
20 | # add transformation after idldoc to force non-proportional font |
---|
21 | # on bloc delimited by |
---|
22 | # <fixe> |
---|
23 | # </fixe> |
---|
24 | # in .pro files (with modification of css) |
---|
25 | # !! do not replace \ by \\ inside this block |
---|
26 | # !! replace \ by an other character is a good idea |
---|
27 | # cf. example in ToBeReviewed/TRIANGULATION/definetri.pro |
---|
28 | # fplod 2006-07-21T08:23:52Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
29 | # add mini_notice production |
---|
30 | # fplod 2006-07-11T08:26:05Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
31 | # commented tidy in dohtml section is moved in makehtml |
---|
32 | # fplod 2006-07-10T08:22:53Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
33 | # ajout de white-space: pre; dans la css pour file_comments |
---|
34 | # fplod 2006-07-04T13:09:19Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
35 | # for idldoc html output |
---|
36 | # because preformat option doesn't seem to work well |
---|
37 | # replace |
---|
38 | # div class="value" |
---|
39 | # by |
---|
40 | # div class="preformat" |
---|
41 | # fplod 2006-06-19T08:46:39Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
42 | # for idldoc html output |
---|
43 | #. replace |
---|
44 | # -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \ |
---|
45 | # -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \ |
---|
46 | # -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \ |
---|
47 | # by |
---|
48 | # -e 's@\(href="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\("\)@\1\2?format=raw\3@g' \ |
---|
49 | # -e 's@\(href="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\(#.*"\)@\1\2?format=raw\3@g' \ |
---|
50 | #-e 's@\(src="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\("\)@\1\2?format=raw\3@g' |
---|
51 | # in order to be able to add ?format=raw several time on one line |
---|
52 | # . suppress .html in line like |
---|
53 | # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html |
---|
54 | # in files idldoc-index*.html |
---|
55 | # fplod 2006-06-14T12:41:37Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
56 | # add embed parameter idldoc instructions to try to fix ticket#17 |
---|
57 | # fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
58 | # add g option in ?format=raw sed transformation in order to fix |
---|
59 | # link on top of idldoc like directory-overview.html |
---|
60 | # fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
61 | # add ?format=raw in idldoc production for frames |
---|
62 | # fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
63 | # add action for idldochtml |
---|
64 | # fplod 2006-06-02T14:28:30Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
65 | # modification to produce tar files in /tmp/saxo_${$} when dotar=1 |
---|
66 | # modification to copy tar files on http://forge.ipsl.jussieu.fr/saxo/download/ |
---|
67 | # when doforge=1 |
---|
68 | # produce tar files in /tmp/saxo_${$} when dotar=1 |
---|
69 | set -x |
---|
70 | set -u |
---|
71 | # |
---|
72 | docompileall=1 |
---|
73 | dohtml=0 |
---|
74 | dooldtest=0 |
---|
75 | doidlwavedoc=0 |
---|
76 | doidldoc=0 |
---|
77 | doTARsrc=0 |
---|
78 | doTARdata=0 |
---|
79 | doforge=0 |
---|
80 | doSRClodyc=0 |
---|
81 | doDTAlodyc=0 |
---|
82 | doSRCipsl=0 |
---|
83 | doDTAipsl=0 |
---|
84 | doSRCidris=0 |
---|
85 | doDTAidris=0 |
---|
86 | # |
---|
87 | case $( whoami ) in |
---|
88 | smasson) |
---|
89 | lgforge=smasson |
---|
90 | ;; |
---|
91 | floseb) |
---|
92 | lgforge=smasson |
---|
93 | ;; |
---|
94 | *) |
---|
95 | lgforge=saxo |
---|
96 | ;; |
---|
97 | esac |
---|
98 | # |
---|
99 | if [ ${lgforge} != smasson ] |
---|
100 | then |
---|
101 | doSRClodyc=0 |
---|
102 | doDTAlodyc=0 |
---|
103 | doSRCipsl=0 |
---|
104 | doDTAipsl=0 |
---|
105 | doSRCidris=0 |
---|
106 | doDTAidris=0 |
---|
107 | fi |
---|
108 | # |
---|
109 | # get the date in a nice format |
---|
110 | # |
---|
111 | ndate=`date +%Y%m%d` |
---|
112 | rev=$( svn info | grep -i revision | awk '{print $NF}' ) |
---|
113 | # memorize current directory |
---|
114 | memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc |
---|
115 | # |
---|
116 | #------------------------------------------------------------------ |
---|
117 | if [ ${docompileall} -eq 1 ] |
---|
118 | then |
---|
119 | cat <<EOF > /tmp/compileall${$}.pro |
---|
120 | .reset_session |
---|
121 | ; |
---|
122 | !path = expand_path('+' + '../..') + ':' + expand_path('+' + !dir) |
---|
123 | resolve_all, resolve_either='def_myuniquetmpdir', skip_routines = ['xxx2ps','trends', 'label_gmt'] |
---|
124 | resolve_all, resolve_either = 'find', skip_routines = ['xxx2ps','trends', 'label_gmt'] |
---|
125 | def_myuniquetmpdir |
---|
126 | oldcm = find('oldcm_empty') |
---|
127 | ;oldcm = find('oldcm_full') |
---|
128 | oldcm = oldcm[0] |
---|
129 | @cm_general |
---|
130 | file_copy, oldcm, myuniquetmpdir + 'oldcm_used.pro', /overwrite |
---|
131 | IF !journal NE 0 THEN journal |
---|
132 | journal, myuniquetmpdir + 'cm_demomode_used.pro' |
---|
133 | journal |
---|
134 | ; |
---|
135 | resolve_all, resolve_either='keep_compatibility', skip_routines = ['xxx2ps','trends', 'label_gmt'] |
---|
136 | ; |
---|
137 | EOF |
---|
138 | # |
---|
139 | for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt ) |
---|
140 | do |
---|
141 | # does it contains pro or function ? |
---|
142 | egrep -iq '^ * *(pro|function)' $i |
---|
143 | if [ $? -eq 0 ] |
---|
144 | then |
---|
145 | echo "print, '$( basename $i .pro ) :'" >> /tmp/compileall${$}.pro |
---|
146 | echo "resolve_all, resolve_either = '$( basename $i .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt']" >> /tmp/compileall${$}.pro |
---|
147 | fi |
---|
148 | done |
---|
149 | echo exit >> /tmp/compileall${$}.pro |
---|
150 | IDL_STARTUP=/tmp/compileall${$}.pro |
---|
151 | ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$} |
---|
152 | echo |
---|
153 | echo |
---|
154 | grep -i "error" /tmp/compileallerr_${$} |
---|
155 | # grep -q "Compilation error(s)" /tmp/compileallerr_${$} |
---|
156 | if [ ${?} -ne 0 ] |
---|
157 | then |
---|
158 | echo "ALL SAXO files are OK..." |
---|
159 | rm -f /tmp/compileallerr_${$} /tmp/compileall${$}.pro |
---|
160 | else |
---|
161 | grep "Compilation error(s)" /tmp/compileallerr_${$} |
---|
162 | echo "eee : see /tmp/compileallerr_${$}" |
---|
163 | more /tmp/compileallerr_${$} |
---|
164 | exit 1 |
---|
165 | fi |
---|
166 | echo |
---|
167 | echo |
---|
168 | fi |
---|
169 | #------------------------------------------------------------------ |
---|
170 | if [ ${dohtml} -eq 1 ] |
---|
171 | then |
---|
172 | # |
---|
173 | # redo the html file |
---|
174 | # |
---|
175 | cd ${memopwd} |
---|
176 | for docxml in firststeps.xml getsaxo.xml mailing.xml websaxo.xml tiplink.xml updatesaxo.xml whatissaxo.xml whatsnew.xml infoupdatekwd.xml infoupdatecm.xml mini_notice.xml faqsaxo.xml |
---|
177 | do |
---|
178 | ./makehtml.sh $(basename ${docxml} .xml) |
---|
179 | status=${?} |
---|
180 | if [ ${status} -ne 0 ] |
---|
181 | then |
---|
182 | echo "eee : pb with makehtml.sh $(basename ${docxml} .xml)" |
---|
183 | exit 1 |
---|
184 | fi |
---|
185 | done |
---|
186 | exit 0 |
---|
187 | fi |
---|
188 | #------------------------------------------------------------------ |
---|
189 | if [ ${dooldtest} -eq 1 ] |
---|
190 | then |
---|
191 | # make the old test |
---|
192 | # |
---|
193 | cd ${memopwd}/../../Tests/ |
---|
194 | ./makeold.sh |
---|
195 | exit 0 |
---|
196 | fi |
---|
197 | #------------------------------------------------------------------ |
---|
198 | if [ ${doidlwavedoc} -eq 1 ] |
---|
199 | then |
---|
200 | # |
---|
201 | # redo idlwave doc |
---|
202 | # |
---|
203 | cd ${memopwd}/../.. |
---|
204 | Documentation/idlwave_catalog -v -f saxo |
---|
205 | exit 0 |
---|
206 | fi |
---|
207 | #------------------------------------------------------------------ |
---|
208 | if [ ${doidldoc} -eq 1 ] |
---|
209 | then |
---|
210 | # |
---|
211 | # build a idl file to launch idldoc |
---|
212 | output=../idldoc_html_output/ |
---|
213 | log="/tmp/idldochtlm_${$}.log" |
---|
214 | pro="/tmp/idldochtlm_${$}.pro" |
---|
215 | cat <<EOF > ${pro} |
---|
216 | !path = expand_path('+' + '../idldoc/') |
---|
217 | print,!path |
---|
218 | idldoc,root="../../",title="SAXO Documentation", $ |
---|
219 | LOG_FILE="${log}", $ |
---|
220 | output="${output}", $ |
---|
221 | overview="../../overview", /statistics, /preformat, /embed |
---|
222 | exit |
---|
223 | EOF |
---|
224 | # launch idl with the file built above |
---|
225 | IDL_STARTUP=${pro};${IDL_DIR}/bin/idl |
---|
226 | /bin/rm ${pro} |
---|
227 | # In order to do not have to many revision in svn, we modify some |
---|
228 | # lines produced by idldoc : |
---|
229 | # - add Source link in each html file |
---|
230 | # example : |
---|
231 | # <td>Source</td> |
---|
232 | # will be replaced by |
---|
233 | # <td><a href="../../Calendar/caldat.pro?format=raw" title="Source code of a file">Source</a></td> |
---|
234 | # |
---|
235 | # - remove date and time of idldoc production |
---|
236 | # examples : |
---|
237 | # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> |
---|
238 | # will be replaced by |
---|
239 | # <!-- Generated by IDLdoc 2.0 --> |
---|
240 | # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun 7 10:54:37 2006.</div |
---|
241 | # will be replaced by |
---|
242 | # <div id="tagline">Produced by IDLdoc 2.0</div> |
---|
243 | # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> |
---|
244 | # will be delete |
---|
245 | # other lines will be deleted because the time is the time of checkout not |
---|
246 | # the time of revision. |
---|
247 | # the sequence of lines |
---|
248 | #<dl> |
---|
249 | # <dt>Last modification:</dt> |
---|
250 | # <dd>Fri Jun 2 11:46:24 2006</dd> |
---|
251 | # </dl> |
---|
252 | # should also be removed ++ je ne sais pas dire en sed la ligne |
---|
253 | # suivant l'occurence de Last modification |
---|
254 | # add ?format=raw to links on html files |
---|
255 | cat << EOF > /tmp/css_modification |
---|
256 | p.preformat { |
---|
257 | font-family: Courier; |
---|
258 | } |
---|
259 | EOF |
---|
260 | # count of directory levels in output |
---|
261 | # this ount will be use to format relative path later |
---|
262 | nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}') |
---|
263 | # |
---|
264 | list_html=$(find ${output} -name "*.html") |
---|
265 | for file_html in ${list_html} |
---|
266 | do |
---|
267 | # build the .pro file name |
---|
268 | bfile=$(basename ${file_html} .html) |
---|
269 | # retrieve the path of html file relative to memopwd (so relative to |
---|
270 | # output). This path will be used in "Source" link. |
---|
271 | nblev2=$(dirname ${file_html} | sed -e "s@/\$@@" | awk -F "/" '{print NF}') |
---|
272 | difflev=$((${nblev2} - ${nblev1})) |
---|
273 | if [ ${difflev} -ge 2 ] |
---|
274 | then |
---|
275 | ilev=1 |
---|
276 | reloutput_html=".." |
---|
277 | while [ ${ilev} -le ${difflev} ] |
---|
278 | do |
---|
279 | reloutput_html="${reloutput_html}/.." |
---|
280 | ilev=$(( ${ilev} + 1 )) |
---|
281 | done |
---|
282 | relpath_html=$(dirname ${file_html} | \ |
---|
283 | sed -e "s@${output}@${reloutput_html}@" \ |
---|
284 | -e "s@\$@/@") |
---|
285 | echo "relpath ${relpath_html})" |
---|
286 | else |
---|
287 | relpath_html="./" |
---|
288 | fi |
---|
289 | # echo "relpath ${relpath_html}/${bfile}" |
---|
290 | sed \ |
---|
291 | -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro?format=raw\" title=\"Source code of a file\">Source<\/a><\/td>@" \ |
---|
292 | -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ |
---|
293 | -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \ |
---|
294 | -e "/<h2>Produced on/d" \ |
---|
295 | -e "/Last modification:/d" \ |
---|
296 | -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ |
---|
297 | -e 's@\(href="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\("\)@\1\2?format=raw\3@g' \ |
---|
298 | -e 's@\(href="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\(#.*"\)@\1\2?format=raw\3@g' \ |
---|
299 | -e 's@\(src="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\("\)@\1\2?format=raw\3@g' \ |
---|
300 | -e 's@<div class="value">@<div class="preformat">@' \ |
---|
301 | -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \ |
---|
302 | -e 's@^ <fixe>@<p class="preformat">@' \ |
---|
303 | -e 's@^ </fixe>@</p>@' \ |
---|
304 | -e '/Main styles/r /tmp/css_modification' \ |
---|
305 | ${file_html} > ${file_html}_modify |
---|
306 | mv ${file_html}_modify ${file_html} |
---|
307 | done |
---|
308 | rm /tmp/css_modification |
---|
309 | # suppress ".html" in idldoc-index*.html in lines like |
---|
310 | # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html |
---|
311 | list_html=$(find ${output} -name "idldoc-index*.html") |
---|
312 | for file_html in ${list_html} |
---|
313 | do |
---|
314 | sed \ |
---|
315 | -e "s/\(a parameter from the routine \)\(.*\)\(.html\)/\1\2/" \ |
---|
316 | ${file_html} > ${file_html}_modify |
---|
317 | mv ${file_html}_modify ${file_html} |
---|
318 | done |
---|
319 | echo "iii : you can see log file in ${log}" |
---|
320 | echo "iii : and look ${output}/idldoc-warnings.html#undoc" |
---|
321 | # |
---|
322 | # build a idl file to launch idldoc |
---|
323 | output=../idldoc_assistant_output/ |
---|
324 | log="/tmp/idldocassistant_${$}.log" |
---|
325 | pro="/tmp/idldocassistant_${$}.pro" |
---|
326 | cat <<EOF > ${pro} |
---|
327 | !path = expand_path('+' + '../idldoc/') |
---|
328 | print,!path |
---|
329 | idldoc,root="../../",title="SAXO Documentation Assistant", $ |
---|
330 | LOG_FILE="${log}", $ |
---|
331 | output="${output}", overview='../../overview', /statistics, /preformat, /embed, /assistant |
---|
332 | exit |
---|
333 | EOF |
---|
334 | # launch idl with the file built above |
---|
335 | IDL_STARTUP=${pro};${IDL_DIR}/bin/idl |
---|
336 | /bin/rm ${pro} |
---|
337 | # In order to do not have to many revision in svn, we modify some |
---|
338 | # lines produced by idldoc : |
---|
339 | # examples : |
---|
340 | # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> |
---|
341 | # will be replaced by |
---|
342 | # <!-- Generated by IDLdoc 2.0 --> |
---|
343 | # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun 7 10:54:37 2006.</div |
---|
344 | # will be replaced by |
---|
345 | # <div id="tagline">Produced by IDLdoc 2.0</div> |
---|
346 | # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> |
---|
347 | # will be delete |
---|
348 | # other lines will be deleted because the time is the time of checkout not |
---|
349 | # the time of revision. |
---|
350 | # the sequence of lines |
---|
351 | #<dl> |
---|
352 | # <dt>Last modification:</dt> |
---|
353 | # <dd>Fri Jun 2 11:46:24 2006</dd> |
---|
354 | # </dl> |
---|
355 | # should also be removed ++ je ne sais pas dire en sed la ligne |
---|
356 | # suivant l'occurence de Last modification |
---|
357 | # replace *_param_* in href attributes because anchors are badly written |
---|
358 | # with _keyword_ |
---|
359 | #++ -e 's@\(href="#_.*\)\(_param_\)\(.*"\)@\1_keyword_\3@g' \ # ++ pb global |
---|
360 | # DON'T add here (in assistant idldoc output) ?format=raw to link because |
---|
361 | # ONLINE_HELP, book="../idldoc_assistant_output/idldoc-lib.adp", /full_path # won't work |
---|
362 | list_html=$(find ${output} -name "*.html") |
---|
363 | for file_html in ${list_html} |
---|
364 | do |
---|
365 | sed \ |
---|
366 | -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ |
---|
367 | -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \ |
---|
368 | -e "/<h2>Produced on/d" \ |
---|
369 | -e "/Last modification:/d" \ |
---|
370 | -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ |
---|
371 | -e '/href/s@_param_@_keyword_@g' \ |
---|
372 | -e 's@<div class="value">@<div class="preformat">@' \ |
---|
373 | -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \ |
---|
374 | -e 's@^ <fixe>@<pre style="font-family: Courier;">@' \ |
---|
375 | -e 's@^ </fixe>@</pre>@' \ |
---|
376 | ${file_html} > ${file_html}_modify |
---|
377 | mv ${file_html}_modify ${file_html} |
---|
378 | done |
---|
379 | # add the directory-overview.html from dir-files.html in idldoc_html_output |
---|
380 | list_html=$(find ../idldoc_html_output -name dir-files.html) |
---|
381 | for file_html in ${list_html} |
---|
382 | do |
---|
383 | fout=../idldoc_assistant_output/${file_html#../idldoc_html_output/*} |
---|
384 | fout=${fout%/*}/directory-overview.html |
---|
385 | sed -e 's/?format=raw//g' ${file_html} > ${fout} |
---|
386 | done |
---|
387 | echo "iii : you can see log file in ${log}" |
---|
388 | echo "iii : and look ${output}/idldoc-warnings.html#undoc" |
---|
389 | fi |
---|
390 | #------------------------------------------------------------------ |
---|
391 | if [ ${doTARsrc} -eq 1 ] |
---|
392 | then |
---|
393 | localtarbase=/tmp/savesaxo_${$} |
---|
394 | mkdir ${localtarbase}/ |
---|
395 | # clean backup files : *~ |
---|
396 | find ${memopwd}/../../.. -name "*~" -exec rm {} \; |
---|
397 | # prepare the source tar (without the svn...) |
---|
398 | # |
---|
399 | cd ${memopwd}/../../.. |
---|
400 | tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC |
---|
401 | # |
---|
402 | # informations |
---|
403 | echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" |
---|
404 | ls -l ${localtarbase} |
---|
405 | fi |
---|
406 | #------------------------------------------------------------------ |
---|
407 | if [ ${doTARdata} -eq 1 ] |
---|
408 | then |
---|
409 | localtarbase=/tmp/savesaxo_${$} |
---|
410 | mkdir ${localtarbase}/ |
---|
411 | # |
---|
412 | # prepare the data tar (without the svn...) |
---|
413 | # |
---|
414 | cd ${memopwd}/../../.. |
---|
415 | tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz --exclude .svn DATA |
---|
416 | # |
---|
417 | # informations |
---|
418 | echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" |
---|
419 | ls -l ${localtarbase} |
---|
420 | fi |
---|
421 | #------------------------------------------------------------------ |
---|
422 | if [ ${doforge} -eq 1 ] |
---|
423 | then |
---|
424 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" |
---|
425 | if [ ${doTARsrc} -ne 1 ] |
---|
426 | then |
---|
427 | localtarbase=${1} |
---|
428 | fi |
---|
429 | scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ |
---|
430 | echo "iii : do not forget to update getsaxo.html" |
---|
431 | echo "iii : \$ ./makehtml.sh getsaxo" |
---|
432 | echo "iii : do not forget to clean ${localtarbase}" |
---|
433 | fi |
---|
434 | #------------------------------------------------------------------ |
---|
435 | if [[ ($doDTAlodyc -eq 1) || ($doDTAipsl -eq 1) ]] |
---|
436 | then |
---|
437 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" |
---|
438 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
439 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
440 | filedata=$(basename $filedata) |
---|
441 | cat <<EOF > job_data_$$ |
---|
442 | #!/bin/bash |
---|
443 | cd SAXO_DIR |
---|
444 | # |
---|
445 | rm -rf DATA |
---|
446 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata |
---|
447 | gunzip $filedata |
---|
448 | tar vxf $( basename $filedata .gz ) |
---|
449 | rm -f $( basename $filedata .gz ) |
---|
450 | # |
---|
451 | chmod -R 755 * |
---|
452 | exit |
---|
453 | # |
---|
454 | EOF |
---|
455 | fi |
---|
456 | #------------------------------------------------------------------ |
---|
457 | if [ $doSRClodyc -eq 1 ] |
---|
458 | then |
---|
459 | # update src on cerbere |
---|
460 | # |
---|
461 | echo "iii : update src on cerbere" |
---|
462 | ssh smasson@cerbere.lodyc.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" |
---|
463 | fi |
---|
464 | #------------------------------------------------------------------ |
---|
465 | if [ $doDTAlodyc -eq 1 ] |
---|
466 | then |
---|
467 | # update data on cerbere |
---|
468 | echo "iii : update data on cerbere" |
---|
469 | scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:. |
---|
470 | ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" |
---|
471 | fi |
---|
472 | #------------------------------------------------------------------ |
---|
473 | if [ $doSRCipsl -eq 1 ] |
---|
474 | then |
---|
475 | # update src on calcul2 |
---|
476 | # |
---|
477 | echo "iii : update src on calcul2" |
---|
478 | ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" |
---|
479 | fi |
---|
480 | #------------------------------------------------------------------ |
---|
481 | if [ $doDTAipsl -eq 1 ] |
---|
482 | then |
---|
483 | # update data on cook |
---|
484 | echo "iii : update data on cook" |
---|
485 | scp job_data_$$ smlod@cook.ipsl.jussieu.fr:. |
---|
486 | ssh smlod@cook.ipsl.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" |
---|
487 | fi |
---|
488 | #------------------------------------------------------------------ |
---|
489 | if [ $doSRCidris -eq 1 ] |
---|
490 | then |
---|
491 | # update src on rhodes |
---|
492 | echo "iii : update src to rhodes" |
---|
493 | ssh reee217@rhodes.idris.fr "/usr/local/pub/svn/svn-1.3.1/bin/svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" |
---|
494 | fi |
---|
495 | #------------------------------------------------------------------ |
---|
496 | if [ $doDTAidris -eq 1 ] |
---|
497 | then |
---|
498 | # create the update script for rhodes |
---|
499 | if [[ ($doDTAlodyc -eq 0) && ($doDTAipsl -eq 0) ]] |
---|
500 | then |
---|
501 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" |
---|
502 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
503 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
504 | filedata=$(basename $filedata) |
---|
505 | fi |
---|
506 | cat <<EOF > job_data_idris_$$ |
---|
507 | #!/bin/ksh |
---|
508 | cd SAXO_DIR |
---|
509 | # |
---|
510 | rm -rf DATA |
---|
511 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" |
---|
512 | scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/$filedata . |
---|
513 | gunzip $filedata |
---|
514 | tar vxf $( basename $filedata .gz ) |
---|
515 | rm -f $( basename $filedata .gz ) |
---|
516 | # |
---|
517 | chmod -R 755 * |
---|
518 | exit |
---|
519 | # |
---|
520 | EOF |
---|
521 | # update data on gaya |
---|
522 | echo "iii : update data to gaya" |
---|
523 | scp job_data_idris_$$ reee217@gaya.idris.fr:. |
---|
524 | ssh reee217@gaya.idris.fr "chmod 755 job_data_idris_$$ ; ./job_data_idris_$$ ; rm -f job_data_idris_$$" |
---|
525 | fi |
---|
526 | #------------------------------------------------------------------ |
---|
527 | # |
---|
528 | [ -f job_src_$$ ] && rm -f job_src_$$ |
---|
529 | [ -f job_data_$$ ] && rm -f job_data_$$ |
---|
530 | [ -f job_data_idris_$$ ] && rm -f job_data_idris_$$ |
---|
531 | # |
---|
532 | exit |
---|
533 | # |
---|