source: trunk/SRC/Documentation/xmldoc/savesaxo.sh @ 249

Last change on this file since 249 was 249, checked in by smasson, 17 years ago

update documentation

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