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