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
RevLine 
[144]1#!/bin/bash
[186]2#
[123]3# update :
4# $Id$
[191]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
[189]14# fplod 2006-09-21T13:05:32Z aedon.locean-ipsl.upmc.fr (Darwin)
[191]15# add an svn id in idldoc-lib.adb after </profile>
[188]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)
[191]19# add copy of html files unedr xmldoc and idldoc_htlm_output on
[188]20# saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
21# see dodocdownload
[187]22# fplod 2006-09-20T11:05:23Z aedon.locean-ipsl.upmc.fr (Darwin)
[191]23# correction to really suppress date in idldoc assistant outputs (font
[187]24# instaed of div in html output)
[183]25# fplod 2006-09-18T13:25:12Z aedon.locean-ipsl.upmc.fr (Darwin)
26# add status checking after makehtml.sh
[182]27# smasson Fri Sep 15 10:42:01 CEST 2006
28# merge idldoc html and idldoc assistant
[179]29# smasson Thu Sep 14 15:19:23 CEST 2006
30# add the revision number in the name of SAXO_SRC_*.tar.gz
[176]31# smasson Wed Sep 13 14:18:02 CEST 2006
32# add the directory-overview.html from dir-files.html in idldoc_html_output
[170]33# fplod 2006-09-07T08:09:47Z aedon.locean-ipsl.upmc.fr (Darwin)
34# main is rename to websaxo
[168]35# fplod 2006-09-05T15:39:47Z aedon.locean-ipsl.upmc.fr (Darwin)
36# add Source link in idldoc html outpout
[163]37# snlod/fplod 2006-08-25T08:30:36Z electre.locean-ipsl.upmc.fr (Darwin)
38# add for idldoc assistant
[156]39# fplod 2006-08-17T09:19:06Z aedon.locean-ipsl.upmc.fr (Darwin)
[183]40# add transformation after idldoc to force non-proportional font
[156]41# on bloc delimited by
[163]42#  <fixe>
43#  </fixe>
[156]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
[144]48# fplod 2006-07-21T08:23:52Z aedon.locean-ipsl.upmc.fr (Darwin)
49# add mini_notice production
[140]50# fplod 2006-07-11T08:26:05Z aedon.locean-ipsl.upmc.fr (Darwin)
51# commented tidy in dohtml section is moved in makehtml
[135]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
[123]54# fplod 2006-07-04T13:09:19Z aedon.locean-ipsl.upmc.fr (Darwin)
[186]55# for idldoc html output
[123]56# because preformat option doesn't seem to work well
[186]57# replace
[123]58# div class="value"
59# by
60# div class="preformat"
[111]61# fplod 2006-06-19T08:46:39Z aedon.locean-ipsl.upmc.fr (Darwin)
[186]62# for idldoc html output
[111]63#. replace
64#     -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
65#     -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \
[123]66#     -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
[186]67# by
[111]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
[186]72# . suppress .html in line like
[111]73# a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html
74# in files idldoc-index*.html
[109]75# fplod 2006-06-14T12:41:37Z aedon.locean-ipsl.upmc.fr (Darwin)
[183]76# add embed parameter idldoc instructions to try to fix ticket#17
[91]77# fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin)
[186]78# add g option in ?format=raw sed transformation in order to fix
[91]79# link on top of idldoc like directory-overview.html
[90]80# fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin)
81# add ?format=raw in idldoc production for frames
[89]82# fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin)
83# add action for idldochtml
[86]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#
[189]92docompileall=1
[86]93dohtml=0
94dooldtest=0
[107]95doidlwavedoc=0
[182]96doidldoc=0
[116]97doTARsrc=0
[88]98doTARdata=0
[116]99doforge=0
[88]100doSRClodyc=0
101doDTAlodyc=0
[100]102doSRCipsl=0
103doDTAipsl=0
104doSRCidris=0
105doDTAidris=0
[189]106dodocdownload=0
[86]107#
[100]108case $( whoami ) in
109    smasson)
110        lgforge=smasson
111    ;;
112    floseb)
113        lgforge=smasson
114    ;;
115    *)
116        lgforge=saxo
117    ;;
118esac
[88]119#
[100]120if [ ${lgforge} != smasson ]
121then
122    doSRClodyc=0
123    doDTAlodyc=0
124    doSRCipsl=0
125    doDTAipsl=0
126    doSRCidris=0
127    doDTAidris=0
[186]128fi
[100]129#
[88]130# get the date in a nice format
131#
132ndate=`date +%Y%m%d`
[179]133rev=$( svn info | grep -i revision | awk '{print $NF}' )
[86]134# memorize current directory
135memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc
[100]136#
[88]137#------------------------------------------------------------------
[100]138if [ ${docompileall} -eq 1 ]
139    then
140    cat <<EOF > /tmp/compileall${$}.pro
[186]141.reset_session
[114]142;
[100]143!path = expand_path('+' + '../..') + ':' + expand_path('+' + !dir)
[115]144resolve_all, resolve_either='def_myuniquetmpdir', skip_routines = ['xxx2ps','trends', 'label_gmt']
145resolve_all, resolve_either = 'find', skip_routines = ['xxx2ps','trends', 'label_gmt']
[114]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'
[186]154journal
[114]155;
[115]156resolve_all, resolve_either='keep_compatibility', skip_routines = ['xxx2ps','trends', 'label_gmt']
[114]157;
[100]158EOF
159#
[115]160    for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt )
[100]161      do
[115]162# does it contains pro or function ?
163      egrep -iq '^ *    *(pro|function)' $i
[100]164      if [ $? -eq 0 ]
165          then
[115]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
[100]168      fi
169    done
170    echo exit >> /tmp/compileall${$}.pro
171    IDL_STARTUP=/tmp/compileall${$}.pro
[120]172    ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$}
[100]173    echo
174    echo
[114]175    grep -i "error" /tmp/compileallerr_${$}
176#    grep -q "Compilation error(s)" /tmp/compileallerr_${$}
[186]177    if [ ${?} -ne 0 ]
[105]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_${$}"
[115]184     more /tmp/compileallerr_${$}
[105]185     exit 1
186    fi
[100]187    echo
188    echo
189fi
190#------------------------------------------------------------------
[86]191if [ ${dohtml} -eq 1 ]
192then
193#
194# redo the html file
195#
196    cd ${memopwd}
[186]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
[86]198    do
[140]199      ./makehtml.sh $(basename ${docxml} .xml)
[183]200      status=${?}
201      if [ ${status} -ne 0 ]
202      then
203       echo "eee : pb with makehtml.sh $(basename ${docxml} .xml)"
204       exit 1
205      fi
[86]206    done
207fi
[88]208#------------------------------------------------------------------
[86]209if [ ${dooldtest} -eq 1 ]
210then
211# make the old test
212#
213    cd ${memopwd}/../../Tests/
214    ./makeold.sh
215    exit 0
216fi
[88]217#------------------------------------------------------------------
[86]218if  [ ${doidlwavedoc} -eq 1 ]
219then
220#
221# redo idlwave doc
222#
[107]223    cd ${memopwd}/../..
[86]224    Documentation/idlwave_catalog -v -f saxo
225    exit 0
226fi
[88]227#------------------------------------------------------------------
[182]228if  [ ${doidldoc} -eq 1 ]
[86]229then
230#
[89]231    # build a idl file to launch idldoc
[111]232    output=../idldoc_html_output/
233    log="/tmp/idldochtlm_${$}.log"
234    pro="/tmp/idldochtlm_${$}.pro"
235    cat <<EOF > ${pro}
[89]236!path = expand_path('+' + '../idldoc/')
237print,!path
[111]238idldoc,root="../../",title="SAXO Documentation", $
239LOG_FILE="${log}", $
[163]240output="${output}", $
[191]241overview="../../overview", /statistics, /preformat
[89]242exit
243EOF
244    # launch idl with the file built above
[120]245    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
[111]246    /bin/rm ${pro}
[89]247    # In order to do not have to many revision in svn, we modify some
248    # lines produced by idldoc :
[191]249    # - add Source link in each html file corresponding to a .pro file
[168]250    # example :
251    # <td>Source</td>
252    # will be replaced by
[188]253    # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td>
[168]254    #
255    # - remove date and time of idldoc production
[89]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>
[186]264    # will be delete
265    # other lines will be deleted because the time is the time of checkout not
[89]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
[191]274    #
[168]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    #
[191]279    list_html_pro=$(find ${output} -name "*.html" -exec grep  -l "<title>.*\.pro" {} \;)
280    for file_html in ${list_html_pro}
[89]281    do
[183]282     # build the .pro file name
[168]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}"
[89]305     sed \
[188]306     -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \
[191]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 \
[89]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" \
[123]319     -e 's@<div class="value">@<div class="preformat">@' \
[135]320     -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \
[191]321     -e 's@^ <fixe>@<pre>@' \
322     -e 's@^ </fixe>@</pre>@' \
323     -e 's@xhtml-transitional@xhtml1-transitional@' \
[89]324     ${file_html} > ${file_html}_modify
325     mv ${file_html}_modify ${file_html}
326    done
[111]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"
[86]339#
[163]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 -->
[187]361    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0 on Wed Sep 13 16:32:10 2006.</font></p>
[163]362    # will be replaced by
[187]363    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0</font></p>
[163]364    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
[186]365    # will be delete
366    # other lines will be deleted because the time is the time of checkout not
[163]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/" \
[187]384     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \
[163]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;/' \
[191]391     -e 's@^ <fixe>@<pre>@' \
[163]392     -e 's@^ </fixe>@</pre>@' \
393     ${file_html} > ${file_html}_modify
394     mv ${file_html}_modify ${file_html}
395    done
[176]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/*}
[186]401      fout=${fout%/*}/directory-overview.html
[188]402      cp ${file_html} ${fout}
[176]403    done
[189]404    # add an id in idldoc-lib.adp
405    cat << EOF > /tmp/adp_modification
406<!-- \$Id\$ -->
407EOF
[191]408    sed -e "/<\/profile>/r /tmp/adp_modification" \
[189]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
[163]414    echo "iii : you can see log file in ${log}"
415    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
[86]416fi
[88]417#------------------------------------------------------------------
418if [ ${doTARsrc} -eq 1 ]
[86]419then
420    localtarbase=/tmp/savesaxo_${$}
421    mkdir  ${localtarbase}/
[87]422# clean backup files : *~
[88]423    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
[87]424# prepare the source tar (without the svn...)
[86]425#
[87]426    cd ${memopwd}/../../..
[179]427    tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC
[86]428#
[87]429#   informations
[89]430    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
[87]431    ls -l ${localtarbase}
432fi
[88]433#------------------------------------------------------------------
434if [ ${doTARdata} -eq 1 ]
[87]435then
436    localtarbase=/tmp/savesaxo_${$}
437    mkdir  ${localtarbase}/
[86]438#
[87]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#
[86]444#   informations
[89]445    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
[86]446    ls -l ${localtarbase}
447fi
[88]448#------------------------------------------------------------------
[86]449if [ ${doforge} -eq 1 ]
450then
[100]451    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"
[88]452    if [ ${doTARsrc} -ne 1 ]
[86]453    then
[89]454       localtarbase=${1}
[86]455    fi
[100]456    scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
[86]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
[88]461#------------------------------------------------------------------
[100]462if [[ ($doDTAlodyc -eq 1) || ($doDTAipsl -eq 1) ]]
[88]463then
[100]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)
[88]468    cat <<EOF > job_data_$$
[100]469#!/bin/bash
[88]470cd SAXO_DIR
[86]471#
[88]472rm -rf DATA
473wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata
[114]474gunzip $filedata
475tar vxf $( basename $filedata .gz )
476rm -f $( basename $filedata .gz )
[88]477#
478chmod -R 755 *
479exit
480#
[86]481EOF
[88]482fi
483#------------------------------------------------------------------
484if [ $doSRClodyc -eq 1 ]
485then
486# update src on cerbere
[86]487#
[100]488    echo "iii : update src on cerbere"
[115]489    ssh smasson@cerbere.lodyc.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
[88]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#------------------------------------------------------------------
[100]500if [ $doSRCipsl -eq 1 ]
501then
[116]502# update src on calcul2
[100]503#
[116]504    echo "iii : update src on calcul2"
505    ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
[100]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#------------------------------------------------------------------
[88]516if [ $doSRCidris -eq 1 ]
517then
518# update src on rhodes
519    echo "iii : update src to rhodes"
[115]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"
[88]521fi
522#------------------------------------------------------------------
523if [ $doDTAidris -eq 1 ]
524then
[100]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
[88]548# update data on gaya
549    echo "iii : update data to gaya"
[100]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_$$"
[88]552fi
553#------------------------------------------------------------------
[188]554if [ ${dodocdownload} -eq 1 ]
555then
556    # ++ on pourrait peut-etre faire un rsync en enlevant les .sh et le .xsl
[189]557    # et faire le ménage des fichiers qui n'existent plus
[188]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    #
[191]568    # replace relative path
[189]569    # by http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/
[191]570    # on ulink lines containing some directories like ../../ToBeReviewed/ or ../../Test/ or file like newheader.txt
[188]571    list_html=$(find /tmp/download_${$}/ -name "*.html")
572    for file_html in ${list_html}
573    do
[191]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}
[188]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#------------------------------------------------------------------
[86]588#
[88]589[ -f job_src_$$ ] && rm -f job_src_$$
[100]590[ -f job_data_$$ ] && rm -f job_data_$$
591[ -f job_data_idris_$$ ] && rm -f job_data_idris_$$
[86]592#
[88]593exit
[86]594#
Note: See TracBrowser for help on using the repository browser.