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

Last change on this file since 191 was 191, checked in by pinsard, 18 years ago

remove format=raw in all html files 2+ : correction for all_plots; suppression of css and correction of Source links in idldoc html output

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