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

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

documentations tools improvements

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