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

Last change on this file since 376 was 363, checked in by smasson, 16 years ago

update documentation

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