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

Last change on this file since 413 was 413, checked in by pinsard, 15 years ago

doidldoc.sh ok for HTML

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