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

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

documentations tools improvements

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