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

Last change on this file since 262 was 262, checked in by pinsard, 17 years ago

corrections of some headers and parameters and keywords case. change of pro2href to replace proidl

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 23.9 KB
Line 
1#!/bin/bash
2#
3# update :
4# $Id$
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>
8# fplod 2007-06-26T14:33:12Z aedon.locean-ipsl.upmc.fr (Darwin)
9# copy listings.css in idldoc_assistant_output
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
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!
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
25# fplod 2006-09-21T13:05:32Z aedon.locean-ipsl.upmc.fr (Darwin)
26# add an svn id in idldoc-lib.adb after </profile>
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)
30# add copy of html files unedr xmldoc and idldoc_html_output on
31# saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
32# see dodocdownload
33# fplod 2006-09-20T11:05:23Z aedon.locean-ipsl.upmc.fr (Darwin)
34# correction to really suppress date in idldoc assistant outputs (font
35# instaed of div in html output)
36# fplod 2006-09-18T13:25:12Z aedon.locean-ipsl.upmc.fr (Darwin)
37# add status checking after makehtml.sh
38# smasson Fri Sep 15 10:42:01 CEST 2006
39# merge idldoc html and idldoc assistant
40# smasson Thu Sep 14 15:19:23 CEST 2006
41# add the revision number in the name of SAXO_SRC_*.tar.gz
42# smasson Wed Sep 13 14:18:02 CEST 2006
43# add the directory-overview.html from dir-files.html in idldoc_html_output
44# fplod 2006-09-07T08:09:47Z aedon.locean-ipsl.upmc.fr (Darwin)
45# main is rename to websaxo
46# fplod 2006-09-05T15:39:47Z aedon.locean-ipsl.upmc.fr (Darwin)
47# add Source link in idldoc html outpout
48# snlod/fplod 2006-08-25T08:30:36Z electre.locean-ipsl.upmc.fr (Darwin)
49# add for idldoc assistant
50# fplod 2006-08-17T09:19:06Z aedon.locean-ipsl.upmc.fr (Darwin)
51# add transformation after idldoc to force non-proportional font
52# on bloc delimited by
53#  <fixe>
54#  </fixe>
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
59# fplod 2006-07-21T08:23:52Z aedon.locean-ipsl.upmc.fr (Darwin)
60# add mini_notice production
61# fplod 2006-07-11T08:26:05Z aedon.locean-ipsl.upmc.fr (Darwin)
62# commented tidy in dohtml section is moved in makehtml
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
65# fplod 2006-07-04T13:09:19Z aedon.locean-ipsl.upmc.fr (Darwin)
66# for idldoc html output
67# because preformat option doesn't seem to work well
68# replace
69# div class="value"
70# by
71# div class="preformat"
72# fplod 2006-06-19T08:46:39Z aedon.locean-ipsl.upmc.fr (Darwin)
73# for idldoc html output
74#. replace
75#     -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
76#     -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \
77#     -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
78# by
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
83# . suppress .html in line like
84# a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html
85# in files idldoc-index*.html
86# fplod 2006-06-14T12:41:37Z aedon.locean-ipsl.upmc.fr (Darwin)
87# add embed parameter idldoc instructions to try to fix ticket#17
88# fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin)
89# add g option in ?format=raw sed transformation in order to fix
90# link on top of idldoc like directory-overview.html
91# fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin)
92# add ?format=raw in idldoc production for frames
93# fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin)
94# add action for idldochtml
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#
103docompileall=1
104dohtml=0
105dooldtest=0
106doidlwavedoc=0
107doidldoc=0
108doTARsrc=0
109doTARdata=0
110doforge=0
111doSRClodyc=0
112doDTAlodyc=0
113doSRCipsl=0
114doDTAipsl=0
115doSRCidris=0
116doDTAidris=0
117dodocdownload=0
118#
119case $( whoami ) in
120    smasson)
121        lgforge=smasson
122    ;;
123    floseb)
124        lgforge=smasson
125    ;;
126    *)
127        lgforge=saxo
128    ;;
129esac
130#
131if [ ${lgforge} != smasson ]
132then
133    doSRClodyc=0
134    doDTAlodyc=0
135    doSRCipsl=0
136    doDTAipsl=0
137    doSRCidris=0
138    doDTAidris=0
139fi
140#
141# get the date in a nice format
142#
143ndate=`date +%Y%m%d`
144rev=$( svn info | grep -i revision | awk '{print $NF}' )
145# memorize current directory
146memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc
147#
148#------------------------------------------------------------------
149if [ ${docompileall} -eq 1 ]
150    then
151    cat <<EOF > /tmp/compileall${$}.pro
152.reset_session
153;
154!path = expand_path('+' + '../..') + ':' + expand_path('+' + !dir)
155resolve_all, resolve_either='def_myuniquetmpdir', skip_routines = ['xxx2ps','trends', 'label_gmt']
156resolve_all, resolve_either = 'find', skip_routines = ['xxx2ps','trends', 'label_gmt']
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
163!path = myuniquetmpdir + ':' + !path
164IF !journal NE 0 THEN journal
165journal, myuniquetmpdir + 'cm_demomode_used.pro'
166journal
167path_cache, /rebuild
168;
169resolve_all, resolve_either='keep_compatibility', skip_routines = ['xxx2ps','trends', 'label_gmt']
170;
171EOF
172#
173    for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt )
174      do
175# does it contains pro or function ?
176      egrep -iq '^ *    *(pro|function)' ${i}
177      if [ ${?} -eq 0 ]
178          then
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
181      fi
182    done
183    echo exit >> /tmp/compileall${$}.pro
184    IDL_STARTUP=/tmp/compileall${$}.pro
185    ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$}
186    echo
187    echo
188    grep -i "error" /tmp/compileallerr_${$}
189#    grep -q "Compilation error(s)" /tmp/compileallerr_${$}
190    if [ ${?} -ne 0 ]
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_${$}"
197     more /tmp/compileallerr_${$}
198     exit 1
199    fi
200    echo
201    echo
202fi
203#------------------------------------------------------------------
204if [ ${dohtml} -eq 1 ]
205then
206#
207# redo the html file
208#
209    cd ${memopwd}
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
211    do
212      ./makehtml.sh $(basename ${docxml} .xml)
213      status=${?}
214      if [ ${status} -ne 0 ]
215      then
216       echo "eee : pb with makehtml.sh $(basename ${docxml} .xml)"
217       exit 1
218      fi
219    done
220fi
221#------------------------------------------------------------------
222if [ ${dooldtest} -eq 1 ]
223then
224# make the old test
225#
226    cd ${memopwd}/../../Tests/
227    ./makeold.sh
228    exit 0
229fi
230#------------------------------------------------------------------
231if  [ ${doidlwavedoc} -eq 1 ]
232then
233#
234# redo idlwave doc
235#
236    cd ${memopwd}/../..
237    Documentation/idlwave_catalog -v -f saxo
238    exit 0
239fi
240#------------------------------------------------------------------
241if  [ ${doidldoc} -eq 1 ]
242then
243#
244    # build a idl file to launch idldoc
245    output=../idldoc_html_output/
246    log="/tmp/idldochtml_${$}.log"
247    pro="/tmp/idldochtml_${$}.pro"
248    cat <<EOF > ${pro}
249!path = expand_path('+' + '../idldoc/')
250print,!path
251idldoc,root="../../",title="SAXO Documentation", $
252LOG_FILE="${log}", $
253output="${output}", $
254overview="../../overview", /statistics, /preformat
255exit
256EOF
257    # launch idl with the file built above
258    IDL_STARTUP=${pro};${IDL_DIR}/bin/idl
259    /bin/rm ${pro}
260    # In order to do not have to many revision in svn, we modify some
261    # lines produced by idldoc :
262    # - add Source link in each html file corresponding to a .pro file
263    # example :
264    # <td>Source</td>
265    # will be replaced by
266    # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td>
267    #
268    # - remove date and time of idldoc production
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>
277    # will be delete
278    # other lines will be deleted because the time is the time of checkout not
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
287    #
288    # count of directory levels in output
289    # this count will be use to format relative path later
290    nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}')
291    #
292    list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;)
293    for file_html in ${list_html_pro}
294    do
295     # build the .pro file name
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@\$@/@")
313      # echo "relpath ${relpath_html})"
314     else
315      relpath_html="./"
316     fi
317     # echo "relpath ${relpath_html}/${bfile}"
318     sed \
319     -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \
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 \
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" \
332     -e 's@<div class="value">@<div class="preformat">@' \
333     -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \
334     -e 's@^ <fixe>@<pre>@' \
335     -e 's@^ </fixe>@</pre>@' \
336     -e 's@xhtml-transitional@xhtml1-transitional@' \
337     ${file_html} > ${file_html}_modify
338     mv ${file_html}_modify ${file_html}
339    done
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
350    # replace <pro>ginette</pro> by a sequence like
351    # <a href="./ginette.html">ginette</a>
352    ./pro2href.sh -i ${output} -r ${output} -e pro
353    status=${?}
354    if [ ${status} -ne 0 ]
355    then
356       echo "eee : pb during ./pro2href.sh for <pro>...</pro>"
357       exit 1
358    fi
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
368    echo "iii : you can see log file in ${log}"
369    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
370#
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 -->
392    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0 on Wed Sep 13 16:32:10 2006.</font></p>
393    # will be replaced by
394    # <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0</font></p>
395    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
396    # will be delete
397    # other lines will be deleted because the time is the time of checkout not
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
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>
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/" \
418     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \
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;/' \
425     -e 's@^ <fixe>@<pre>@' \
426     -e 's@^ </fixe>@</pre>@' \
427     -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \
428     -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \
429     ${file_html} > ${file_html}_modify
430     mv ${file_html}_modify ${file_html}
431    done
432    # replace <pro>ginette</pro> by a sequence like
433    # <a href="./ginette.html">ginette</a>
434    ./pro2href.sh -i ${output} -r ${output} -e pro
435    status=${?}
436    if [ ${status} -ne 0 ]
437    then
438       echo "eee : pb during ./pro2href.sh for <pro>...</pro>"
439       exit 1
440    fi
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
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/*}
455      fout=${fout%/*}/directory-overview.html
456      cp ${file_html} ${fout}
457    done
458    # copy listings.css (needed by directory-overview.html files)
459    cp ../idldoc/resource/listings.css ${output}
460    # add an id in idldoc-lib.adp
461    cat << EOF > /tmp/adp_modification
462<!-- \$Id\$ -->
463EOF
464    sed -e "/<\/profile>/r /tmp/adp_modification" \
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
470    echo "iii : you can see log file in ${log}"
471    echo "iii : and look ${output}/idldoc-warnings.html#undoc"
472    # check that the number of existing html files for each .pro file is 2!
473    for i in $( find ../.. -name "*.pro" )
474    do
475      nhtml=$( find ../.. -name $( basename ${i} .pro ).html | wc -l )
476      if [ ${nhtml} -ne 2 ]
477          then
478          echo ERROR there is not 2 $( basename ${i} .pro ).html files
479          find ../.. -name $( basename ${i} .pro ).html
480          echo
481      fi
482    done
483fi
484#------------------------------------------------------------------
485if [ ${doTARsrc} -eq 1 ]
486then
487    localtarbase=/tmp/savesaxo_${$}
488    mkdir  ${localtarbase}/
489# clean backup files : *~
490    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
491# prepare the source tar (without the svn...)
492#
493    cd ${memopwd}/../../..
494    tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC
495#
496#   informations
497    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
498    ls -l ${localtarbase}
499fi
500#------------------------------------------------------------------
501if [ ${doTARdata} -eq 1 ]
502then
503    localtarbase=/tmp/savesaxo_${$}
504    mkdir  ${localtarbase}/
505#
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#
511#   informations
512    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
513    ls -l ${localtarbase}
514fi
515#------------------------------------------------------------------
516if [ ${doforge} -eq 1 ]
517then
518    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"
519    if [ ${doTARsrc} -ne 1 ]
520    then
521       localtarbase=${1}
522    fi
523    scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
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
528#------------------------------------------------------------------
529if [[ (${doDTAlodyc} -eq 1) || (${doDTAipsl} -eq 1) ]]
530then
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}')
534    filedata=$(basename ${filedata})
535    cat <<EOF > job_data_$$
536#!/bin/bash
537cd SAXO_DIR
538#
539rm -rf DATA
540wget http://forge.ipsl.jussieu.fr/saxo/download/${filedata}
541gunzip ${filedata}
542tar vxf $( basename ${filedata} .gz )
543rm -f $( basename ${filedata} .gz )
544#
545chmod -R 755 *
546exit
547#
548EOF
549fi
550#------------------------------------------------------------------
551if [ ${doSRClodyc} -eq 1 ]
552then
553# update src on cerbere
554#
555    echo "iii : update src on cerbere"
556    ssh smasson@cerbere.lodyc.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
557fi
558#------------------------------------------------------------------
559if [ ${doDTAlodyc} -eq 1 ]
560then
561# update data on cerbere
562    echo "iii : update data on cerbere"
563    scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:.
564    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
565fi
566#------------------------------------------------------------------
567if [ ${doSRCipsl} -eq 1 ]
568then
569# update src on calcul2
570#
571    echo "iii : update src on calcul2"
572    ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR"
573fi
574#------------------------------------------------------------------
575if [ ${doDTAipsl} -eq 1 ]
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#------------------------------------------------------------------
583if [ ${doSRCidris} -eq 1 ]
584then
585# update src on rhodes
586    echo "iii : update src to rhodes"
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"
588fi
589#------------------------------------------------------------------
590if [ ${doDTAidris} -eq 1 ]
591then
592# create the update script for rhodes
593    if [[ (${doDTAlodyc} -eq 0) && (${doDTAipsl} -eq 0) ]]
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}')
598        filedata=$(basename ${filedata})
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"
606scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/${filedata} .
607gunzip ${filedata}
608tar vxf $( basename ${filedata} .gz )
609rm -f $( basename ${filedata} .gz )
610#
611chmod -R 755 *
612exit
613#
614EOF
615# update data on gaya
616    echo "iii : update data to gaya"
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_$$"
619fi
620#------------------------------------------------------------------
621if [ ${dodocdownload} -eq 1 ]
622then
623    # ++ on pourrait peut-etre faire un rsync en enlevant les .sh et le .xsl
624    # et faire le ménage des fichiers qui n'existent plus
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_${$}/
629    cp -rp ../xmldoc /tmp/download_${$}/
630    cp -rp ../idldoc_html_output /tmp/download_${$}/
631    #
632    # remove svn files
633    find /tmp/download_${$}/ -name ".svn" -exec rm -rf {} \;
634    #
635    # replace relative path
636    # by http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/
637    # on ulink lines containing some directories like ../../ToBeReviewed/ or ../../Test/ or file like newheader.txt
638    list_html=$(find /tmp/download_${$}/ -name "*.html")
639    for file_html in ${list_html}
640    do
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}
649    done
650    echo
651    echo give SAXO password if asked
652    scp -rp /tmp/download_${$}/* saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
653    rm -rf /tmp/download_${$}/
654fi
655#------------------------------------------------------------------
656#------------------------------------------------------------------
657#
658[ -f job_src_$$ ] && rm -f job_src_$$
659[ -f job_data_$$ ] && rm -f job_data_$$
660[ -f job_data_idris_$$ ] && rm -f job_data_idris_$$
661#
662exit
663#
Note: See TracBrowser for help on using the repository browser.