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

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

include parts of ncdf_read into ncdf_read_varget. Should have no impact...

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