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

Last change on this file was 495, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines; trailing blanks

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