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

Last change on this file since 321 was 321, checked in by smasson, 17 years ago

update documentation

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