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

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

correction of savesaxo to handle format=raw for frames Documentation/idldoc_html_output/index.html

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