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

Last change on this file since 422 was 422, checked in by pinsard, 14 years ago

fix links in firststeps.html

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