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

Last change on this file since 105 was 105, checked in by pinsard, 18 years ago

bugfix compute_fromreg_imoms3_weigaddr and square2quadrilateral

  • Property svn:executable set to *
File size: 11.5 KB
Line 
1#!/bin/bash
2# fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin)
3# add g option in ?format=raw sed transformation in order to fix
4# link on top of idldoc like directory-overview.html
5# fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin)
6# add ?format=raw in idldoc production for frames
7# fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin)
8# add action for idldochtml
9# fplod 2006-06-02T14:28:30Z aedon.locean-ipsl.upmc.fr (Darwin)
10# modification to produce tar files in /tmp/saxo_${$} when dotar=1
11# modification to copy tar files on http://forge.ipsl.jussieu.fr/saxo/download/
12# when doforge=1
13# produce tar files in /tmp/saxo_${$} when dotar=1
14set -x
15set -u
16#
17docompileall=1
18dohtml=0
19dooldtest=0
20doidldoc_html=0
21doidldoc_assistant=0
22doidlwavedoc=0
23doTARsrc=0
24doTARdata=0
25doforge=0
26doSRClodyc=0
27doDTAlodyc=0
28doSRCipsl=0
29doDTAipsl=0
30doSRCidris=0
31doDTAidris=0
32#
33case $( whoami ) in
34    smasson)
35        lgforge=smasson
36    ;;
37    floseb)
38        lgforge=smasson
39    ;;
40    *)
41        lgforge=saxo
42    ;;
43esac
44#
45if [ ${lgforge} != smasson ]
46then
47    doSRClodyc=0
48    doDTAlodyc=0
49    doSRCipsl=0
50    doDTAipsl=0
51    doSRCidris=0
52    doDTAidris=0
53fi   
54#
55# get the date in a nice format
56#
57ndate=`date +%Y%m%d`
58# memorize current directory
59memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc
60#
61#------------------------------------------------------------------
62if [ ${docompileall} -eq 1 ]
63    then
64    cat <<EOF > /tmp/compileall${$}.pro
65!path = expand_path('+' + '../..') + ':' + expand_path('+' + !dir)
66keep_compatibility, 0
67@all_cm
68EOF
69#
70    for i in $( find ${memopwd}/../../ -name "*.pro" )
71      do
72# does it contains return ?
73      grep -iq '^ *return' $i
74      if [ $? -eq 0 ]
75          then
76# does it contains pro or function ?
77          egrep -iq '^ *(pro|function)' $i
78          if [ $? -eq 0 ]
79              then
80              echo ".r $( basename $i .pro )" >> /tmp/compileall${$}.pro
81          fi
82      fi
83    done
84    echo exit >> /tmp/compileall${$}.pro
85    IDL_STARTUP=/tmp/compileall${$}.pro
86    $IDL_DIR/bin/idl &> /tmp/compileallerr_${$}
87    echo
88    echo
89    grep -q "Compilation error(s)" /tmp/compileallerr_${$}
90    if [ ${?} -ne 0 ]
91    then
92     echo "ALL SAXO files are OK..."
93     rm -f /tmp/compileallerr_${$} /tmp/compileall${$}.pro
94    else
95     grep "Compilation error(s)" /tmp/compileallerr_${$}
96     echo "eee : see /tmp/compileallerr_${$}"
97     exit 1
98    fi
99    echo
100    echo
101fi
102#------------------------------------------------------------------
103if [ ${dohtml} -eq 1 ]
104then
105#
106# redo the html file
107#
108    cd ${memopwd}
109    for docxml in firststeps.xml getsaxo.xml mailing.xml main.xml tiplink.xml updatesaxo.xml whatissaxo.xml whatsnew.xml
110    do
111    ./makehtml.sh $(basename ${docxml} .xml)
112 #   tidy -m $(basename ${docxml}).html
113    done
114    exit 0
115fi
116#------------------------------------------------------------------
117if [ ${dooldtest} -eq 1 ]
118then
119# make the old test
120#
121    cd ${memopwd}/../../Tests/
122    ./makeold.sh
123    exit 0
124fi
125#------------------------------------------------------------------
126if  [ ${doidlwavedoc} -eq 1 ]
127then
128#
129# redo idlwave doc
130#
131    cd ${memopwd}/../
132    Documentation/idlwave_catalog -v -f saxo
133    exit 0
134fi
135#------------------------------------------------------------------
136if  [ ${doidldoc_html} -eq 1 ]
137then
138#
139    # build a idl file to launch idldoc
140    cat <<EOF > /tmp/idldoc_html_${$}.pro
141!path = expand_path('+' + '../idldoc/')
142print,!path
143idldoc,root="../../",title="SAXO Documentation",LOG_FILE="/tmp/idldochtlm_${$}.log", $
144output="../idldoc_html_output",/preformat
145exit
146EOF
147    # launch idl with the file built above
148    IDL_STARTUP=/tmp/idldoc_html_${$}.pro;idl
149    /bin/rm /tmp/idldoc_html_${$}.pro
150    # In order to do not have to many revision in svn, we modify some
151    # lines produced by idldoc :
152    # examples :
153    # <!-- Generated by IDLdoc 2.0 on Wed Jun  7 10:25:28 2006 -->
154    # will be replaced by
155    # <!-- Generated by IDLdoc 2.0 -->
156    # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun  7 10:54:37 2006.</div
157    # will be replaced by
158    # <div id="tagline">Produced by IDLdoc 2.0</div>
159    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
160    # will be delete
161    # other lines will be deleted because the time is the time of checkout not
162    # the time of revision.
163    # the sequence of lines
164    #<dl>
165    #      <dt>Last modification:</dt>
166    #       <dd>Fri Jun  2 11:46:24 2006</dd>
167    #    </dl>
168    # should also be removed ++ je ne sais pas dire en sed la ligne
169    # suivant l'occurence de Last modification
170    # add ?format=rawx to links on html files
171    list_html=$(find ../idldoc_html_output/ -name "*.html")
172    for file_html in ${list_html}
173    do
174     sed \
175     -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \
176     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \
177     -e "/<h2>Produced on/d" \
178     -e "/Last modification:/d" \
179     -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \
180     -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
181     -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \
182     -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
183     ${file_html} > ${file_html}_modify
184     mv ${file_html}_modify ${file_html}
185    done
186    echo "iii : you can see log file in /tmp/idldochtlm_${$}.log"
187    echo "iii : and look ../idldoc_html_output/idldoc-warnings.html#undoc"
188    exit 1
189fi
190#------------------------------------------------------------------
191if  [ ${doidldoc_assistant} -eq 1 ]
192then
193#
194    echo "eee : pas encore ecrit"
195    exit 1
196fi
197#------------------------------------------------------------------
198if [ ${doTARsrc} -eq 1 ]
199then
200    localtarbase=/tmp/savesaxo_${$}
201    mkdir  ${localtarbase}/
202# clean backup files : *~
203    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
204# prepare the source tar (without the svn...)
205#
206    cd ${memopwd}/../../..
207    tar czf ${localtarbase}/SAXO_SRC_${ndate}.tar.gz --exclude .svn SRC
208#
209#   informations
210    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
211    ls -l ${localtarbase}
212fi
213#------------------------------------------------------------------
214if [ ${doTARdata} -eq 1 ]
215then
216    localtarbase=/tmp/savesaxo_${$}
217    mkdir  ${localtarbase}/
218#
219# prepare the data tar (without the svn...)
220#
221    cd ${memopwd}/../../..
222    tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz  --exclude .svn DATA
223#
224#   informations
225    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
226    ls -l ${localtarbase}
227fi
228#------------------------------------------------------------------
229if [ ${doforge} -eq 1 ]
230then
231    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"
232    if [ ${doTARsrc} -ne 1 ]
233    then
234       localtarbase=${1}
235    fi
236    scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
237    echo "iii : do not forget to update getsaxo.html"
238    echo "iii : \$ ./makehtml.sh getsaxo"
239    echo "iii : do not forget to clean ${localtarbase}"
240fi
241#------------------------------------------------------------------
242if [[ ($doSRClodyc -eq 1) || ($doSRCipsl -eq 1) ]]
243then
244    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
245    infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz  | head -n 1)
246    filesrc=$(echo ${infosrc} | awk '{print $NF}')
247    filesrc=$( basename $filesrc )
248#
249    cat <<EOF > job_src_$$
250#!/bin/bash
251cd SAXO_DIR
252#
253rm -rf SRC
254wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc
255gunzip $filesrc
256tar vxfz $filesrc
257rm -f $filesrc
258#
259chmod -R 755 *
260exit
261#
262EOF
263fi
264#
265if [[ ($doDTAlodyc -eq 1) || ($doDTAipsl -eq 1) ]]
266then
267    echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
268    infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
269    filedata=$(echo ${infodata} | awk '{print $NF}')
270    filedata=$(basename $filedata)
271    cat <<EOF > job_data_$$
272#!/bin/bash
273cd SAXO_DIR
274#
275rm -rf DATA
276wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata
277tar vxfz $filedata
278rm -f $filedata
279#
280chmod -R 755 *
281exit
282#
283EOF
284fi
285#------------------------------------------------------------------
286if [ $doSRClodyc -eq 1 ]
287then
288# update src on cerbere
289#
290    echo "iii : update src on cerbere"
291    scp job_src_$$ smasson@cerbere.lodyc.jussieu.fr:.
292    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
293fi
294#------------------------------------------------------------------
295if [ $doDTAlodyc -eq 1 ]
296then
297# update data on cerbere
298    echo "iii : update data on cerbere"
299    scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:.
300    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
301fi
302#------------------------------------------------------------------
303if [ $doSRCipsl -eq 1 ]
304then
305# update src on cook
306#
307    echo "iii : update src on cook"
308    scp job_src_$$ smlod@cook.ipsl.jussieu.fr:.
309    ssh smlod@cook.ipsl.jussieu.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
310fi
311#------------------------------------------------------------------
312if [ $doDTAipsl -eq 1 ]
313then
314# update data on cook
315    echo "iii : update data on cook"
316    scp job_data_$$ smlod@cook.ipsl.jussieu.fr:.
317    ssh smlod@cook.ipsl.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
318fi
319#------------------------------------------------------------------
320if [ $doSRCidris -eq 1 ]
321then
322# create the update script for rhodes
323    if [[ ($doSRClodyc -eq 0) && ($doSRCipsl -eq 0) ]]
324        then
325        echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
326        infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz  | head -n 1)
327        filesrc=$(echo ${infosrc} | awk '{print $NF}')
328        filesrc=$( basename $filesrc )
329    fi
330#
331    cat <<EOF > job_src_idris_$$
332#!/bin/ksh
333cd SAXO_DIR
334#
335rm -rf SRC
336echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
337scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/$filesrc .
338gunzip $filesrc
339tar vxf $( basename $filesrc .gz )
340rm -f $( basename $filesrc .gz )
341#
342chmod -R 755 *
343exit
344#
345EOF
346# update src on rhodes
347    echo "iii : update src to rhodes"
348    scp job_src_idris_$$ reee217@rhodes.idris.fr:.
349    ssh reee217@rhodes.idris.fr "chmod 755 job_src_idris_$$ ; ./job_src_idris_$$ ; rm -f job_src_idris_$$"
350fi
351#------------------------------------------------------------------
352if [ $doDTAidris -eq 1 ]
353then
354# create the update script for rhodes
355    if [[ ($doDTAlodyc -eq 0) && ($doDTAipsl -eq 0) ]]
356        then
357        echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
358        infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
359        filedata=$(echo ${infodata} | awk '{print $NF}')
360        filedata=$(basename $filedata)
361    fi
362    cat <<EOF > job_data_idris_$$
363#!/bin/ksh
364cd SAXO_DIR
365#
366rm -rf DATA
367echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd"
368scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/$filedata .
369gunzip $filedata
370tar vxf $( basename $filedata .gz )
371rm -f $( basename $filedata .gz )
372#
373chmod -R 755 *
374exit
375#
376EOF
377# update data on gaya
378    echo "iii : update data to gaya"
379    scp job_data_idris_$$ reee217@gaya.idris.fr:.
380    ssh reee217@gaya.idris.fr "chmod 755 job_data_idris_$$ ; ./job_data_idris_$$ ; rm -f job_data_idris_$$"
381fi
382#------------------------------------------------------------------
383#
384[ -f job_src_$$ ] && rm -f job_src_$$
385[ -f job_data_$$ ] && rm -f job_data_$$
386[ -f job_src_idris_$$ ] && rm -f job_src_idris_$$
387[ -f job_data_idris_$$ ] && rm -f job_data_idris_$$
388#
389exit
390#
Note: See TracBrowser for help on using the repository browser.