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

Last change on this file since 235 was 235, checked in by pinsard, 17 years ago

replace some print by some report in some .pro

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 22.7 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=1
99dohtml=0
100dooldtest=0
101doidlwavedoc=0
102doidldoc=0
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
158IF !journal NE 0 THEN journal
159journal, myuniquetmpdir + 'cm_demomode_used.pro'
160journal
161;
162resolve_all, resolve_either='keep_compatibility', skip_routines = ['xxx2ps','trends', 'label_gmt']
163;
164EOF
165#
166    for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt )
167      do
168# does it contains pro or function ?
169      egrep -iq '^ *    *(pro|function)' ${i}
170      if [ ${?} -eq 0 ]
171          then
172          echo "print, '$( basename ${i} .pro ) :'" >> /tmp/compileall${$}.pro
173          echo "resolve_all, resolve_either = '$( basename ${i} .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt']" >> /tmp/compileall${$}.pro
174      fi
175    done
176    echo exit >> /tmp/compileall${$}.pro
177    IDL_STARTUP=/tmp/compileall${$}.pro
178    ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$}
179    echo
180    echo
181    grep -i "error" /tmp/compileallerr_${$}
182#    grep -q "Compilation error(s)" /tmp/compileallerr_${$}
183    if [ ${?} -ne 0 ]
184    then
185     echo "ALL SAXO files are OK..."
186     rm -f /tmp/compileallerr_${$} /tmp/compileall${$}.pro
187    else
188     grep "Compilation error(s)" /tmp/compileallerr_${$}
189     echo "eee : see /tmp/compileallerr_${$}"
190     more /tmp/compileallerr_${$}
191     exit 1
192    fi
193    echo
194    echo
195fi
196#------------------------------------------------------------------
197if [ ${dohtml} -eq 1 ]
198then
199#
200# redo the html file
201#
202    cd ${memopwd}
203    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
204    do
205      ./makehtml.sh $(basename ${docxml} .xml)
206      status=${?}
207      if [ ${status} -ne 0 ]
208      then
209       echo "eee : pb with makehtml.sh $(basename ${docxml} .xml)"
210       exit 1
211      fi
212    done
213fi
214#------------------------------------------------------------------
215if [ ${dooldtest} -eq 1 ]
216then
217# make the old test
218#
219    cd ${memopwd}/../../Tests/
220    ./makeold.sh
221    exit 0
222fi
223#------------------------------------------------------------------
224if  [ ${doidlwavedoc} -eq 1 ]
225then
226#
227# redo idlwave doc
228#
229    cd ${memopwd}/../..
230    Documentation/idlwave_catalog -v -f saxo
231    exit 0
232fi
233#------------------------------------------------------------------
234if  [ ${doidldoc} -eq 1 ]
235then
236#
237    # build a idl file to launch idldoc
238    output=../idldoc_html_output/
239    log="/tmp/idldochtml_${$}.log"
240    pro="/tmp/idldochtml_${$}.pro"
241    cat <<EOF > ${pro}
242!path = expand_path('+' + '../idldoc/')
243print,!path
244idldoc,root="../../",title="SAXO Documentation", $
245LOG_FILE="${log}", $
246output="${output}", $
247overview="../../overview", /statistics, /preformat
248exit
249EOF
250    # launch idl with the file built above
251    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
252    /bin/rm ${pro}
253    # In order to do not have to many revision in svn, we modify some
254    # lines produced by idldoc :
255    # - add Source link in each html file corresponding to a .pro file
256    # example :
257    # <td>Source</td>
258    # will be replaced by
259    # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td>
260    #
261    # - remove date and time of idldoc production
262    # examples :
263    # <!-- Generated by IDLdoc 2.0 on Wed Jun  7 10:25:28 2006 -->
264    # will be replaced by
265    # <!-- Generated by IDLdoc 2.0 -->
266    # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun  7 10:54:37 2006.</div
267    # will be replaced by
268    # <div id="tagline">Produced by IDLdoc 2.0</div>
269    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
270    # will be delete
271    # other lines will be deleted because the time is the time of checkout not
272    # the time of revision.
273    # the sequence of lines
274    #<dl>
275    #      <dt>Last modification:</dt>
276    #       <dd>Fri Jun  2 11:46:24 2006</dd>
277    #    </dl>
278    # should also be removed ++ je ne sais pas dire en sed la ligne
279    # suivant l'occurence de Last modification
280    #
281    # count of directory levels in output
282    # this count will be use to format relative path later
283    nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}')
284    #
285    list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;)
286    for file_html in ${list_html_pro}
287    do
288     # build the .pro file name
289     bfile=$(basename ${file_html} .html)
290     # retrieve the path of html file relative to memopwd (so relative to
291     # output). This path will be used in "Source" link.
292     nblev2=$(dirname ${file_html} |  sed -e "s@/\$@@" | awk -F "/" '{print NF}')
293     difflev=$((${nblev2} - ${nblev1}))
294     if [ ${difflev} -ge 2 ]
295     then
296      ilev=1
297      reloutput_html=".."
298      while [ ${ilev} -le ${difflev} ]
299      do
300       reloutput_html="${reloutput_html}/.."
301       ilev=$(( ${ilev} + 1 ))
302      done
303      relpath_html=$(dirname ${file_html} | \
304                   sed -e "s@${output}@${reloutput_html}@" \
305                       -e "s@\$@/@")
306      # echo "relpath ${relpath_html})"
307     else
308      relpath_html="./"
309     fi
310     # echo "relpath ${relpath_html}/${bfile}"
311     sed \
312     -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \
313     ${file_html} > ${file_html}_modify
314     mv ${file_html}_modify ${file_html}
315    done
316    list_html=$(find ${output} -name "*.html")
317    for file_html in ${list_html}
318    do
319     sed \
320     -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \
321     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \
322     -e "/<h2>Produced on/d" \
323     -e "/Last modification:/d" \
324     -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \
325     -e 's@<div class="value">@<div class="preformat">@' \
326     -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \
327     -e 's@^ <fixe>@<pre>@' \
328     -e 's@^ </fixe>@</pre>@' \
329     -e 's@xhtml-transitional@xhtml1-transitional@' \
330     ${file_html} > ${file_html}_modify
331     mv ${file_html}_modify ${file_html}
332    done
333    # suppress ".html" in idldoc-index*.html in lines like
334    # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html
335    list_html=$(find ${output} -name "idldoc-index*.html")
336    for file_html in ${list_html}
337    do
338     sed \
339     -e "s/\(a parameter from the routine \)\(.*\)\(.html\)/\1\2/" \
340     ${file_html} > ${file_html}_modify
341     mv ${file_html}_modify ${file_html}
342    done
343    # replace <pro>ginette</pro> by a sequence like
344    # <a href="./ginette.html">ginette</a>
345    ./pro2href.sh ${output}
346    status=${?}
347    if [ ${status} -ne 0 ]
348    then
349       echo "eee : pb during ./pro2href.sh"
350       exit 1
351    fi
352    echo "iii : you can see log file in ${log}"
353    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
354#
355    # build a idl file to launch idldoc
356    output=../idldoc_assistant_output/
357    log="/tmp/idldocassistant_${$}.log"
358    pro="/tmp/idldocassistant_${$}.pro"
359    cat <<EOF > ${pro}
360!path = expand_path('+' + '../idldoc/')
361print,!path
362idldoc,root="../../",title="SAXO Documentation Assistant", $
363LOG_FILE="${log}", $
364output="${output}", overview='../../overview', /statistics, /preformat, /embed, /assistant
365exit
366EOF
367    # launch idl with the file built above
368    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
369    /bin/rm ${pro}
370    # In order to do not have to many revision in svn, we modify some
371    # lines produced by idldoc :
372    # examples :
373    # <!-- Generated by IDLdoc 2.0 on Wed Jun  7 10:25:28 2006 -->
374    # will be replaced by
375    # <!-- Generated by IDLdoc 2.0 -->
376    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0 on Wed Sep 13 16:32:10 2006.</font></p>
377    # will be replaced by
378    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0</font></p>
379    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
380    # will be delete
381    # other lines will be deleted because the time is the time of checkout not
382    # the time of revision.
383    # the sequence of lines
384    #<dl>
385    #      <dt>Last modification:</dt>
386    #       <dd>Fri Jun  2 11:46:24 2006</dd>
387    #    </dl>
388    # should also be removed ++ je ne sais pas dire en sed la ligne
389    # suivant l'occurence de Last modification
390    # replace *_param_* in href attributes because anchors are badly written
391    # with _keyword_
392    #++ -e 's@\(href="#_.*\)\(_param_\)\(.*"\)@\1_keyword_\3@g' \ # ++ pb global
393    #  ONLINE_HELP, book="../idldoc_assistant_output/idldoc-lib.adp", /full_path    # won't work
394    # encaspulate example content in <pre> </pre> in idldoc assistant outputs
395    # Examples section is supposed to start with <h3>Examples</h3>
396    # and end is before <h3>Version history</h3>
397    list_html=$(find ${output} -name "*.html")
398    for file_html in ${list_html}
399    do
400     sed \
401     -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \
402     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \
403     -e "/<h2>Produced on/d" \
404     -e "/Last modification:/d" \
405     -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \
406     -e '/href/s@_param_@_keyword_@g' \
407     -e 's@<div class="value">@<div class="preformat">@' \
408     -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \
409     -e 's@^ <fixe>@<pre>@' \
410     -e 's@^ </fixe>@</pre>@' \
411     -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \
412     -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \
413     ${file_html} > ${file_html}_modify
414     mv ${file_html}_modify ${file_html}
415    done
416    # replace <pro>ginette</pro> by a sequence like
417    # <a href="./ginette.html">ginette</a>
418    ./pro2href.sh ${output}
419    status=0
420    status=${?}
421    if [ ${status} -ne 0 ]
422    then
423       echo "eee : pb during ./pro2href.sh"
424       exit 1
425    fi
426    # add the directory-overview.html from dir-files.html in idldoc_html_output
427    list_html=$(find ../idldoc_html_output -name dir-files.html)
428    for file_html in ${list_html}
429    do
430      fout=../idldoc_assistant_output/${file_html#../idldoc_html_output/*}
431      fout=${fout%/*}/directory-overview.html
432      cp ${file_html} ${fout}
433    done
434    # add an id in idldoc-lib.adp
435    cat << EOF > /tmp/adp_modification
436<!-- \$Id\$ -->
437EOF
438    sed -e "/<\/profile>/r /tmp/adp_modification" \
439     ../idldoc_assistant_output/idldoc-lib.adp > \
440     ../idldoc_assistant_output/idldoc-lib.adp_${$}
441    mv ../idldoc_assistant_output/idldoc-lib.adp_${$} \
442    ../idldoc_assistant_output/idldoc-lib.adp
443    rm /tmp/adp_modification
444    echo "iii : you can see log file in ${log}"
445    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
446    # check that the number of existing html files for each .pro file is 2!
447    for i in $( find ../.. -name "*.pro" )
448    do
449      nhtml=$( find ../.. -name $( basename ${i} .pro ).html | wc -l )
450      if [ ${nhtml} -ne 2 ]
451          then
452          echo ERROR there is not 2 $( basename ${i} .pro ).html files
453          find ../.. -name $( basename ${i} .pro ).html
454          echo
455      fi
456    done
457fi
458#------------------------------------------------------------------
459if [ ${doTARsrc} -eq 1 ]
460then
461    localtarbase=/tmp/savesaxo_${$}
462    mkdir  ${localtarbase}/
463# clean backup files : *~
464    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
465# prepare the source tar (without the svn...)
466#
467    cd ${memopwd}/../../..
468    tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC
469#
470#   informations
471    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
472    ls -l ${localtarbase}
473fi
474#------------------------------------------------------------------
475if [ ${doTARdata} -eq 1 ]
476then
477    localtarbase=/tmp/savesaxo_${$}
478    mkdir  ${localtarbase}/
479#
480# prepare the data tar (without the svn...)
481#
482    cd ${memopwd}/../../..
483    tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz  --exclude .svn DATA
484#
485#   informations
486    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
487    ls -l ${localtarbase}
488fi
489#------------------------------------------------------------------
490if [ ${doforge} -eq 1 ]
491then
492    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"
493    if [ ${doTARsrc} -ne 1 ]
494    then
495       localtarbase=${1}
496    fi
497    scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
498    echo "iii : do not forget to update getsaxo.html"
499    echo "iii : \$ ./makehtml.sh getsaxo"
500    echo "iii : do not forget to clean ${localtarbase}"
501fi
502#------------------------------------------------------------------
503if [[ (${doDTAlodyc} -eq 1) || (${doDTAipsl} -eq 1) ]]
504then
505    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
506    infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
507    filedata=$(echo ${infodata} | awk '{print $NF}')
508    filedata=$(basename ${filedata})
509    cat <<EOF > job_data_$$
510#!/bin/bash
511cd SAXO_DIR
512#
513rm -rf DATA
514wget http://forge.ipsl.jussieu.fr/saxo/download/${filedata}
515gunzip ${filedata}
516tar vxf $( basename ${filedata} .gz )
517rm -f $( basename ${filedata} .gz )
518#
519chmod -R 755 *
520exit
521#
522EOF
523fi
524#------------------------------------------------------------------
525if [ ${doSRClodyc} -eq 1 ]
526then
527# update src on cerbere
528#
529    echo "iii : update src on cerbere"
530    ssh smasson@cerbere.lodyc.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
531fi
532#------------------------------------------------------------------
533if [ ${doDTAlodyc} -eq 1 ]
534then
535# update data on cerbere
536    echo "iii : update data on cerbere"
537    scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:.
538    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
539fi
540#------------------------------------------------------------------
541if [ ${doSRCipsl} -eq 1 ]
542then
543# update src on calcul2
544#
545    echo "iii : update src on calcul2"
546    ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
547fi
548#------------------------------------------------------------------
549if [ ${doDTAipsl} -eq 1 ]
550then
551# update data on cook
552    echo "iii : update data on cook"
553    scp job_data_$$ smlod@cook.ipsl.jussieu.fr:.
554    ssh smlod@cook.ipsl.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
555fi
556#------------------------------------------------------------------
557if [ ${doSRCidris} -eq 1 ]
558then
559# update src on rhodes
560    echo "iii : update src to rhodes"
561    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"
562fi
563#------------------------------------------------------------------
564if [ ${doDTAidris} -eq 1 ]
565then
566# create the update script for rhodes
567    if [[ (${doDTAlodyc} -eq 0) && (${doDTAipsl} -eq 0) ]]
568        then
569        echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
570        infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
571        filedata=$(echo ${infodata} | awk '{print $NF}')
572        filedata=$(basename ${filedata})
573    fi
574    cat <<EOF > job_data_idris_$$
575#!/bin/ksh
576cd SAXO_DIR
577#
578rm -rf DATA
579echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
580scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/${filedata} .
581gunzip ${filedata}
582tar vxf $( basename ${filedata} .gz )
583rm -f $( basename ${filedata} .gz )
584#
585chmod -R 755 *
586exit
587#
588EOF
589# update data on gaya
590    echo "iii : update data to gaya"
591    scp job_data_idris_$$ reee217@gaya.idris.fr:.
592    ssh reee217@gaya.idris.fr "chmod 755 job_data_idris_$$ ; ./job_data_idris_$$ ; rm -f job_data_idris_$$"
593fi
594#------------------------------------------------------------------
595if [ ${dodocdownload} -eq 1 ]
596then
597    # ++ on pourrait peut-etre faire un rsync en enlevant les .sh et le .xsl
598    # et faire le ménage des fichiers qui n'existent plus
599    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd several times"
600    #
601    # copy files in a temporary directory
602    mkdir /tmp/download_${$}/
603    cp -rp ../xmldoc /tmp/download_${$}/
604    cp -rp ../idldoc_html_output /tmp/download_${$}/
605    #
606    # remove svn files
607    find /tmp/download_${$}/ -name ".svn" -exec rm -rf {} \;
608    #
609    # replace relative path
610    # by http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/
611    # on ulink lines containing some directories like ../../ToBeReviewed/ or ../../Test/ or file like newheader.txt
612    list_html=$(find /tmp/download_${$}/ -name "*.html")
613    for file_html in ${list_html}
614    do
615     sed  \
616     -e "/Source code of a file/s+../.*/../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \
617     -e "/..\/..\/ToBeReviewed/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \
618     -e "/..\/..\/Test/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+"  \
619     -e "/..\/..\/Calendar/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \
620     -e "/..\/newheader/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/Documentation/+" \
621     ${file_html} > ${file_html}_${$}
622     mv ${file_html}_${$} ${file_html}
623    done
624    echo
625    echo give SAXO password if asked
626    scp -rp /tmp/download_${$}/* saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
627    rm -rf /tmp/download_${$}/
628fi
629#------------------------------------------------------------------
630#------------------------------------------------------------------
631#
632[ -f job_src_$$ ] && rm -f job_src_$$
633[ -f job_data_$$ ] && rm -f job_data_$$
634[ -f job_data_idris_$$ ] && rm -f job_data_idris_$$
635#
636exit
637#
Note: See TracBrowser for help on using the repository browser.