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

Last change on this file since 425 was 425, checked in by smasson, 14 years ago

replace rhodes by ulam

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