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

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

correction for wiki links

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 24.6 KB
RevLine 
[144]1#!/bin/bash
[186]2#
[123]3# update :
4# $Id$
[357]5# fplod 2008-04-28T08:40:23Z aedon.locean-ipsl.upmc.fr (Darwin)
6# add wiki update
[347]7# fplod 2008-04-16T12:23:44Z aedon.locean-ipsl.upmc.fr (Darwin)
8# add wiki production
[345]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
[262]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>
[253]15# fplod 2007-06-26T14:33:12Z aedon.locean-ipsl.upmc.fr (Darwin)
16# copy listings.css in idldoc_assistant_output
[233]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
[195]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!
[191]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
[189]32# fplod 2006-09-21T13:05:32Z aedon.locean-ipsl.upmc.fr (Darwin)
[191]33# add an svn id in idldoc-lib.adb after </profile>
[188]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)
[351]37# add copy of html files under xmldoc and idldoc_html_output on
[188]38# saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
39# see dodocdownload
[187]40# fplod 2006-09-20T11:05:23Z aedon.locean-ipsl.upmc.fr (Darwin)
[191]41# correction to really suppress date in idldoc assistant outputs (font
[187]42# instaed of div in html output)
[183]43# fplod 2006-09-18T13:25:12Z aedon.locean-ipsl.upmc.fr (Darwin)
44# add status checking after makehtml.sh
[182]45# smasson Fri Sep 15 10:42:01 CEST 2006
46# merge idldoc html and idldoc assistant
[179]47# smasson Thu Sep 14 15:19:23 CEST 2006
48# add the revision number in the name of SAXO_SRC_*.tar.gz
[176]49# smasson Wed Sep 13 14:18:02 CEST 2006
50# add the directory-overview.html from dir-files.html in idldoc_html_output
[170]51# fplod 2006-09-07T08:09:47Z aedon.locean-ipsl.upmc.fr (Darwin)
52# main is rename to websaxo
[168]53# fplod 2006-09-05T15:39:47Z aedon.locean-ipsl.upmc.fr (Darwin)
54# add Source link in idldoc html outpout
[163]55# snlod/fplod 2006-08-25T08:30:36Z electre.locean-ipsl.upmc.fr (Darwin)
56# add for idldoc assistant
[156]57# fplod 2006-08-17T09:19:06Z aedon.locean-ipsl.upmc.fr (Darwin)
[183]58# add transformation after idldoc to force non-proportional font
[156]59# on bloc delimited by
[163]60#  <fixe>
61#  </fixe>
[156]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
[144]66# fplod 2006-07-21T08:23:52Z aedon.locean-ipsl.upmc.fr (Darwin)
67# add mini_notice production
[140]68# fplod 2006-07-11T08:26:05Z aedon.locean-ipsl.upmc.fr (Darwin)
69# commented tidy in dohtml section is moved in makehtml
[135]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
[123]72# fplod 2006-07-04T13:09:19Z aedon.locean-ipsl.upmc.fr (Darwin)
[186]73# for idldoc html output
[123]74# because preformat option doesn't seem to work well
[186]75# replace
[123]76# div class="value"
77# by
78# div class="preformat"
[111]79# fplod 2006-06-19T08:46:39Z aedon.locean-ipsl.upmc.fr (Darwin)
[186]80# for idldoc html output
[111]81#. replace
82#     -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
83#     -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \
[123]84#     -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
[186]85# by
[111]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
[186]90# . suppress .html in line like
[111]91# a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html
92# in files idldoc-index*.html
[109]93# fplod 2006-06-14T12:41:37Z aedon.locean-ipsl.upmc.fr (Darwin)
[183]94# add embed parameter idldoc instructions to try to fix ticket#17
[91]95# fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin)
[186]96# add g option in ?format=raw sed transformation in order to fix
[91]97# link on top of idldoc like directory-overview.html
[90]98# fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin)
99# add ?format=raw in idldoc production for frames
[89]100# fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin)
101# add action for idldochtml
[86]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#
[345]110docompileall=0
[357]111dohtml=0
[363]112dowiki=0
[86]113dooldtest=0
[321]114doidlwavedoc=0
[327]115doidldoc=0
[116]116doTARsrc=0
[88]117doTARdata=0
[116]118doforge=0
[291]119doSRClocean=0
120doDTAlocean=0
[100]121doSRCipsl=0
122doDTAipsl=0
123doSRCidris=0
124doDTAidris=0
[189]125dodocdownload=0
[363]126dowikiupdate=0
[86]127#
[100]128case $( whoami ) in
129    smasson)
130        lgforge=smasson
131    ;;
132    floseb)
133        lgforge=smasson
134    ;;
135    *)
136        lgforge=saxo
137    ;;
138esac
[88]139#
[100]140if [ ${lgforge} != smasson ]
141then
[291]142    doSRClocean=0
143    doDTAlocean=0
[100]144    doSRCipsl=0
145    doDTAipsl=0
146    doSRCidris=0
147    doDTAidris=0
[186]148fi
[100]149#
[88]150# get the date in a nice format
151#
152ndate=`date +%Y%m%d`
[179]153rev=$( svn info | grep -i revision | awk '{print $NF}' )
[86]154# memorize current directory
155memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc
[100]156#
[88]157#------------------------------------------------------------------
[100]158if [ ${docompileall} -eq 1 ]
159    then
160    cat <<EOF > /tmp/compileall${$}.pro
[186]161.reset_session
[114]162;
[100]163!path = expand_path('+' + '../..') + ':' + expand_path('+' + !dir)
[115]164resolve_all, resolve_either='def_myuniquetmpdir', skip_routines = ['xxx2ps','trends', 'label_gmt']
165resolve_all, resolve_either = 'find', skip_routines = ['xxx2ps','trends', 'label_gmt']
[114]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
[239]172!path = myuniquetmpdir + ':' + !path
[114]173IF !journal NE 0 THEN journal
174journal, myuniquetmpdir + 'cm_demomode_used.pro'
[186]175journal
[239]176path_cache, /rebuild
[114]177;
[115]178resolve_all, resolve_either='keep_compatibility', skip_routines = ['xxx2ps','trends', 'label_gmt']
[114]179;
[100]180EOF
181#
[324]182    for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt  | grep -iv report )
[100]183      do
[115]184# does it contains pro or function ?
[233]185      egrep -iq '^ *    *(pro|function)' ${i}
186      if [ ${?} -eq 0 ]
[100]187          then
[233]188          echo "print, '$( basename ${i} .pro ) :'" >> /tmp/compileall${$}.pro
[324]189          echo "resolve_all, resolve_either = '$( basename ${i} .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt', 'report']" >> /tmp/compileall${$}.pro
[100]190      fi
191    done
[291]192    echo "exit" >> /tmp/compileall${$}.pro
[100]193    IDL_STARTUP=/tmp/compileall${$}.pro
[120]194    ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$}
[100]195    echo
196    echo
[114]197    grep -i "error" /tmp/compileallerr_${$}
198#    grep -q "Compilation error(s)" /tmp/compileallerr_${$}
[186]199    if [ ${?} -ne 0 ]
[105]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_${$}"
[115]206     more /tmp/compileallerr_${$}
[105]207     exit 1
208    fi
[100]209    echo
210    echo
211fi
212#------------------------------------------------------------------
[86]213if [ ${dohtml} -eq 1 ]
214then
215#
[411]216# redo the HTML files
[86]217#
218    cd ${memopwd}
[345]219    make clean
[357]220    make html
[86]221fi
[88]222#------------------------------------------------------------------
[357]223if [ ${dowiki} -eq 1 ]
224then
225#
[411]226# redo the WIKI files
[357]227#
228    cd ${memopwd}
229    make clean
230    make tracwiki
231fi
232#------------------------------------------------------------------
[86]233if [ ${dooldtest} -eq 1 ]
234then
235# make the old test
236#
237    cd ${memopwd}/../../Tests/
238    ./makeold.sh
239    exit 0
240fi
[88]241#------------------------------------------------------------------
[86]242if  [ ${doidlwavedoc} -eq 1 ]
243then
244#
245# redo idlwave doc
246#
[107]247    cd ${memopwd}/../..
[86]248    Documentation/idlwave_catalog -v -f saxo
249    exit 0
250fi
[88]251#------------------------------------------------------------------
[182]252if  [ ${doidldoc} -eq 1 ]
[86]253then
254#
[89]255    # build a idl file to launch idldoc
[111]256    output=../idldoc_html_output/
[233]257    log="/tmp/idldochtml_${$}.log"
258    pro="/tmp/idldochtml_${$}.pro"
[111]259    cat <<EOF > ${pro}
[89]260!path = expand_path('+' + '../idldoc/')
261print,!path
[111]262idldoc,root="../../",title="SAXO Documentation", $
263LOG_FILE="${log}", $
[163]264output="${output}", $
[191]265overview="../../overview", /statistics, /preformat
[89]266exit
267EOF
268    # launch idl with the file built above
[120]269    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
[111]270    /bin/rm ${pro}
[89]271    # In order to do not have to many revision in svn, we modify some
272    # lines produced by idldoc :
[191]273    # - add Source link in each html file corresponding to a .pro file
[168]274    # example :
275    # <td>Source</td>
276    # will be replaced by
[188]277    # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td>
[168]278    #
279    # - remove date and time of idldoc production
[89]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>
[186]288    # will be delete
289    # other lines will be deleted because the time is the time of checkout not
[89]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
[191]298    #
[168]299    # count of directory levels in output
[233]300    # this count will be use to format relative path later
[168]301    nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}')
302    #
[233]303    list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;)
[191]304    for file_html in ${list_html_pro}
[89]305    do
[183]306     # build the .pro file name
[168]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@\$@/@")
[233]324      # echo "relpath ${relpath_html})"
[168]325     else
326      relpath_html="./"
327     fi
328     # echo "relpath ${relpath_html}/${bfile}"
[89]329     sed \
[188]330     -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \
[191]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 \
[89]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" \
[123]343     -e 's@<div class="value">@<div class="preformat">@' \
[135]344     -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \
[191]345     -e 's@^ <fixe>@<pre>@' \
346     -e 's@^ </fixe>@</pre>@' \
347     -e 's@xhtml-transitional@xhtml1-transitional@' \
[89]348     ${file_html} > ${file_html}_modify
349     mv ${file_html}_modify ${file_html}
350    done
[111]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
[233]361    # replace <pro>ginette</pro> by a sequence like
362    # <a href="./ginette.html">ginette</a>
[262]363    ./pro2href.sh -i ${output} -r ${output} -e pro
[233]364    status=${?}
365    if [ ${status} -ne 0 ]
366    then
[262]367       echo "eee : pb during ./pro2href.sh for <pro>...</pro>"
[233]368       exit 1
369    fi
[262]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
[111]379    echo "iii : you can see log file in ${log}"
380    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
[86]381#
[163]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 -->
[187]403    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0 on Wed Sep 13 16:32:10 2006.</font></p>
[163]404    # will be replaced by
[187]405    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0</font></p>
[163]406    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
[186]407    # will be delete
408    # other lines will be deleted because the time is the time of checkout not
[163]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
[233]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>
[163]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/" \
[187]429     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \
[163]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;/' \
[191]436     -e 's@^ <fixe>@<pre>@' \
[163]437     -e 's@^ </fixe>@</pre>@' \
[233]438     -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \
439     -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \
[163]440     ${file_html} > ${file_html}_modify
441     mv ${file_html}_modify ${file_html}
442    done
[233]443    # replace <pro>ginette</pro> by a sequence like
444    # <a href="./ginette.html">ginette</a>
[262]445    ./pro2href.sh -i ${output} -r ${output} -e pro
[233]446    status=${?}
447    if [ ${status} -ne 0 ]
448    then
[262]449       echo "eee : pb during ./pro2href.sh for <pro>...</pro>"
[233]450       exit 1
451    fi
[262]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
[176]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/*}
[186]466      fout=${fout%/*}/directory-overview.html
[188]467      cp ${file_html} ${fout}
[176]468    done
[253]469    # copy listings.css (needed by directory-overview.html files)
470    cp ../idldoc/resource/listings.css ${output}
[189]471    # add an id in idldoc-lib.adp
472    cat << EOF > /tmp/adp_modification
473<!-- \$Id\$ -->
474EOF
[191]475    sed -e "/<\/profile>/r /tmp/adp_modification" \
[189]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
[163]481    echo "iii : you can see log file in ${log}"
482    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
[195]483    # check that the number of existing html files for each .pro file is 2!
484    for i in $( find ../.. -name "*.pro" )
[233]485    do
486      nhtml=$( find ../.. -name $( basename ${i} .pro ).html | wc -l )
487      if [ ${nhtml} -ne 2 ]
[195]488          then
[291]489          echo "ERROR there is not 2 $( basename ${i} .pro ).html files"
[233]490          find ../.. -name $( basename ${i} .pro ).html
[195]491          echo
492      fi
493    done
[86]494fi
[88]495#------------------------------------------------------------------
496if [ ${doTARsrc} -eq 1 ]
[86]497then
498    localtarbase=/tmp/savesaxo_${$}
499    mkdir  ${localtarbase}/
[87]500# clean backup files : *~
[88]501    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
[87]502# prepare the source tar (without the svn...)
[86]503#
[87]504    cd ${memopwd}/../../..
[179]505    tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC
[86]506#
[87]507#   informations
[89]508    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
[87]509    ls -l ${localtarbase}
510fi
[88]511#------------------------------------------------------------------
512if [ ${doTARdata} -eq 1 ]
[87]513then
514    localtarbase=/tmp/savesaxo_${$}
515    mkdir  ${localtarbase}/
[86]516#
[87]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#
[86]522#   informations
[89]523    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
[86]524    ls -l ${localtarbase}
525fi
[88]526#------------------------------------------------------------------
[86]527if [ ${doforge} -eq 1 ]
528then
[100]529    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"
[88]530    if [ ${doTARsrc} -ne 1 ]
[86]531    then
[89]532       localtarbase=${1}
[86]533    fi
[100]534    scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
[86]535    echo "iii : do not forget to update getsaxo.html"
[345]536    echo "iii : \$ make ./getsaxo.html"
[86]537    echo "iii : do not forget to clean ${localtarbase}"
538fi
[88]539#------------------------------------------------------------------
[291]540if [[ (${doDTAlocean} -eq 1) || (${doDTAipsl} -eq 1) ]]
[88]541then
[100]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}')
[233]545    filedata=$(basename ${filedata})
[88]546    cat <<EOF > job_data_$$
[100]547#!/bin/bash
[88]548cd SAXO_DIR
[86]549#
[88]550rm -rf DATA
[233]551wget http://forge.ipsl.jussieu.fr/saxo/download/${filedata}
552gunzip ${filedata}
553tar vxf $( basename ${filedata} .gz )
554rm -f $( basename ${filedata} .gz )
[88]555#
556chmod -R 755 *
557exit
558#
[86]559EOF
[88]560fi
561#------------------------------------------------------------------
[291]562if [ ${doSRClocean} -eq 1 ]
[88]563then
564# update src on cerbere
[86]565#
[100]566    echo "iii : update src on cerbere"
[304]567    ssh smasson@cerbere.locean-ipsl.upmc.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
[88]568fi
569#------------------------------------------------------------------
[291]570if [ ${doDTAlocean} -eq 1 ]
[88]571then
572# update data on cerbere
573    echo "iii : update data on cerbere"
[304]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_$$"
[88]576fi
577#------------------------------------------------------------------
[233]578if [ ${doSRCipsl} -eq 1 ]
[100]579then
[116]580# update src on calcul2
[100]581#
[116]582    echo "iii : update src on calcul2"
583    ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
[100]584fi
585#------------------------------------------------------------------
[233]586if [ ${doDTAipsl} -eq 1 ]
[100]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#------------------------------------------------------------------
[233]594if [ ${doSRCidris} -eq 1 ]
[88]595then
596# update src on rhodes
597    echo "iii : update src to rhodes"
[209]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"
[88]599fi
600#------------------------------------------------------------------
[233]601if [ ${doDTAidris} -eq 1 ]
[88]602then
[100]603# create the update script for rhodes
[291]604    if [[ (${doDTAlocean} -eq 0) && (${doDTAipsl} -eq 0) ]]
[100]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}')
[233]609        filedata=$(basename ${filedata})
[100]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"
[233]617scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/${filedata} .
618gunzip ${filedata}
619tar vxf $( basename ${filedata} .gz )
620rm -f $( basename ${filedata} .gz )
[100]621#
622chmod -R 755 *
623exit
624#
625EOF
[88]626# update data on gaya
627    echo "iii : update data to gaya"
[100]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_$$"
[88]630fi
631#------------------------------------------------------------------
[188]632if [ ${dodocdownload} -eq 1 ]
633then
634    # ++ on pourrait peut-etre faire un rsync en enlevant les .sh et le .xsl
[189]635    # et faire le ménage des fichiers qui n'existent plus
[188]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_${$}/
[197]640    cp -rp ../xmldoc /tmp/download_${$}/
[188]641    cp -rp ../idldoc_html_output /tmp/download_${$}/
642    #
643    # remove svn files
644    find /tmp/download_${$}/ -name ".svn" -exec rm -rf {} \;
645    #
[191]646    # replace relative path
[189]647    # by http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/
[191]648    # on ulink lines containing some directories like ../../ToBeReviewed/ or ../../Test/ or file like newheader.txt
[188]649    list_html=$(find /tmp/download_${$}/ -name "*.html")
650    for file_html in ${list_html}
651    do
[191]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}
[188]660    done
[197]661    echo
[291]662    echo "give SAXO password if asked"
[197]663    scp -rp /tmp/download_${$}/* saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
[188]664    rm -rf /tmp/download_${$}/
665fi
[357]666#
667# update wiki pages
668if [ ${dowikiupdate} -eq 1 ]
669then
670    # uncomment this following line if you want to start from scratch
[382]671    # ssh saxo@forge.ipsl.jussieu.fr mkdir -p /tmp/saxo
672    rsync -av --exclude=".DS_Store"  --exclude=".svn" ./wiki/ saxo@forge.ipsl.jussieu.fr:/tmp/saxo
673    ssh saxo@forge.ipsl.jussieu.fr trac-admin /ipsl/forge/projets/saxo/trac wiki load /tmp/saxo
[357]674    # uncomment this following line if you want to leave without any trace
[382]675    # ssh saxo@forge.ipsl.jussieu.fr rm -rf /tmp/saxo
[357]676fi
[188]677#------------------------------------------------------------------
678#------------------------------------------------------------------
[86]679#
[88]680[ -f job_src_$$ ] && rm -f job_src_$$
[100]681[ -f job_data_$$ ] && rm -f job_data_$$
682[ -f job_data_idris_$$ ] && rm -f job_data_idris_$$
[86]683#
[357]684exit
Note: See TracBrowser for help on using the repository browser.