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

Last change on this file since 98 was 98, checked in by smasson, 18 years ago

bugfix ncdf_meshread + comments in compute_fromreg_bilinear_weigaddr

  • Property svn:executable set to *
File size: 7.9 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#
17dohtml=0
18dooldtest=0
19doidldoc_html=1
20doidldoc_assistant=0
21doidlwavedoc=0
22doTARsrc=0
23doTARdata=0
24doforge=0
25doSRClodyc=0
26doDTAlodyc=0
27doSRCidris=1
28doDTAidris=1
29#
30#
31# get the date in a nice format
32#
33ndate=`date +%Y%m%d`
34# memorize current directory
35memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc
36#------------------------------------------------------------------
37if [ ${dohtml} -eq 1 ]
38then
39#
40# redo the html file
41#
42    cd ${memopwd}
43    for docxml in firststeps.xml getsaxo.xml mailing.xml main.xml tiplink.xml updatesaxo.xml whatissaxo.xml whatsnew.xml
44    do
45    ./makehtml.sh $(basename ${docxml} .xml)
46 #   tidy -m $(basename ${docxml}).html
47    done
48    exit 0
49fi
50#------------------------------------------------------------------
51if [ ${dooldtest} -eq 1 ]
52then
53# make the old test
54#
55    cd ${memopwd}/../../Tests/
56    ./makeold.sh
57    exit 0
58fi
59#------------------------------------------------------------------
60if  [ ${doidlwavedoc} -eq 1 ]
61then
62#
63# redo idlwave doc
64#
65    cd ${memopwd}/../
66    Documentation/idlwave_catalog -v -f saxo
67    exit 0
68fi
69#------------------------------------------------------------------
70if  [ ${doidldoc_html} -eq 1 ]
71then
72#
73    # build a idl file to launch idldoc
74    cat <<EOF > /tmp/idldoc_html_${$}.pro
75!path = expand_path('+' + '../idldoc/')
76print,!path
77idldoc,root="../../",LOG_FILE="/tmp/idldochtlm_${$}.log", $
78output="../idldoc_html_output",/preformat
79exit
80EOF
81    # launch idl with the file built above
82    IDL_STARTUP=/tmp/idldoc_html_${$}.pro;idl
83    /bin/rm /tmp/idldoc_html_${$}.pro
84    # In order to do not have to many revision in svn, we modify some
85    # lines produced by idldoc :
86    # examples :
87    # <!-- Generated by IDLdoc 2.0 on Wed Jun  7 10:25:28 2006 -->
88    # will be replaced by
89    # <!-- Generated by IDLdoc 2.0 -->
90    # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun  7 10:54:37 2006.</div
91    # will be replaced by
92    # <div id="tagline">Produced by IDLdoc 2.0</div>
93    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
94    # will be delete
95    # other lines will be deleted because the time is the time of checkout not
96    # the time of revision.
97    # the sequence of lines
98    #<dl>
99    #      <dt>Last modification:</dt>
100    #       <dd>Fri Jun  2 11:46:24 2006</dd>
101    #    </dl>
102    # should also be removed ++ je ne sais pas dire en sed la ligne
103    # suivant l'occurence de Last modification
104    # add ?format=rawx to links on html files
105    list_html=$(find ../idldoc_html_output/ -name "*.html")
106    for file_html in ${list_html}
107    do
108     sed \
109     -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \
110     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \
111     -e "/<h2>Produced on/d" \
112     -e "/Last modification:/d" \
113     -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \
114     -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
115     -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \
116     -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
117     ${file_html} > ${file_html}_modify
118     mv ${file_html}_modify ${file_html}
119    done
120    echo "iii : you can see log file in /tmp/idldochtlm_${$}.log"
121    echo "iii : and look ../idldoc_html_output/idldoc-warnings.html#undoc"
122    exit 1
123fi
124#------------------------------------------------------------------
125if  [ ${doidldoc_assistant} -eq 1 ]
126then
127#
128    echo "eee : pas encore ecrit"
129    exit 1
130fi
131#------------------------------------------------------------------
132if [ ${doTARsrc} -eq 1 ]
133then
134    localtarbase=/tmp/savesaxo_${$}
135    mkdir  ${localtarbase}/
136# clean backup files : *~
137    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
138# prepare the source tar (without the svn...)
139#
140    cd ${memopwd}/../../..
141    tar czf ${localtarbase}/SAXO_SRC_${ndate}.tar.gz --exclude .svn SRC
142#
143#   informations
144    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
145    ls -l ${localtarbase}
146fi
147#------------------------------------------------------------------
148if [ ${doTARdata} -eq 1 ]
149then
150    localtarbase=/tmp/savesaxo_${$}
151    mkdir  ${localtarbase}/
152#
153# prepare the data tar (without the svn...)
154#
155    cd ${memopwd}/../../..
156    tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz  --exclude .svn DATA
157#
158#   informations
159    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
160    ls -l ${localtarbase}
161fi
162#------------------------------------------------------------------
163if [ ${doforge} -eq 1 ]
164then
165    echo "iii : you will be asked saxo@forge.ipsl.jussieu.fr passwd two times"
166    if [ ${doTARsrc} -ne 1 ]
167    then
168       localtarbase=${1}
169    fi
170    scp ${localtarbase}/SAXO_*.tar.gz saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
171    echo "iii : do not forget to update getsaxo.html"
172    echo "iii : \$ ./makehtml.sh getsaxo"
173    echo "iii : do not forget to clean ${localtarbase}"
174fi
175#------------------------------------------------------------------
176if [[ ($doSRClodyc -eq 1) || ($doDTAidris -eq 1) ]]
177then
178infosrc=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz  | head -n 1)
179filesrc=$(echo ${infosrc} | awk '{print $NF}')
180filesrc=$( basename $filesrc )
181[ $doSRClodyc -eq 1 ] && rshell=bash || rshell=ksh
182#
183    cat <<EOF > job_src_$$
184#!/bin/${rshell}
185cd SAXO_DIR
186#
187rm -rf SRC
188wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc
189gunzip $filesrc
190tar vxf $( basename $filesrc .gz )
191rm -f $( basename $filesrc .gz )
192#
193chmod -R 755 *
194exit
195#
196EOF
197fi
198#
199if [[ ($doDTAlodyc -eq 1) || ($doDTAidris -eq 1) ]]
200then
201infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
202filedata=$(echo ${infodata} | awk '{print $NF}')
203filedata=$(basename $filedata)
204[ $doDTAlodyc -eq 1 ] && rshell=bash || rshell=ksh
205    cat <<EOF > job_data_$$
206#!/bin/${rshell}
207cd SAXO_DIR
208#
209rm -rf DATA
210wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata
211gunzip $filedata
212tar vxf $( basename $filedata .gz )
213rm -f $( basename $filedata .gz )
214#
215chmod -R 755 *
216exit
217#
218EOF
219fi
220#------------------------------------------------------------------
221if [ $doSRClodyc -eq 1 ]
222then
223# update src on cerbere
224#
225    echo "iii : update src on cerbere  cerbere"
226    scp job_src_$$ smasson@cerbere.lodyc.jussieu.fr:.
227    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
228fi
229#------------------------------------------------------------------
230if [ $doDTAlodyc -eq 1 ]
231then
232# update data on cerbere
233    echo "iii : update data on cerbere"
234    scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:.
235    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
236fi
237#------------------------------------------------------------------
238if [ $doSRCidris -eq 1 ]
239then
240# update src on rhodes
241    echo "iii : update src to rhodes"
242    scp job_src_$$ reee217@rhodes.idris.fr:.
243    ssh reee217@rhodes.idris.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
244fi
245#------------------------------------------------------------------
246if [ $doDTAidris -eq 1 ]
247then
248# update data on gaya
249    echo "iii : update data to gaya"
250    scp job_data_$$ reee217@gaya.idris.fr:.
251    ssh reee217@gaya.idris.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
252fi
253#------------------------------------------------------------------
254#
255[ -f job_src_$$ ] && rm -f job_src_$$
256[ -f job_data_$$ ] && rm -f
257#
258exit
259#
Note: See TracBrowser for help on using the repository browser.