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

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

start to modify headers of Obsolete *.pro files for better idldoc output

  • Property svn:executable set to *
File size: 7.8 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=0
28doDTAidris=0
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#
182    cat <<EOF > job_src_$$
183#!/bin/bash
184cd SAXO_DIR
185#
186rm -rf SRC
187wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc
188gunzip $filesrc
189tar xf $( basename $filesrc .gz )
190rm -f $( basename $filesrc .gz )
191#
192chmod -R 755 *
193exit
194#
195EOF
196fi
197#
198if [[ ($doDTAlodyc -eq 1) || ($doDTAidris -eq 1) ]]
199then
200infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
201filedata=$(echo ${infodata} | awk '{print $NF}')
202filedata=$(basename $filedata)
203    cat <<EOF > job_data_$$
204#!/bin/bash
205cd SAXO_DIR
206#
207rm -rf DATA
208wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata
209gunzip $filedata
210tar xf $( basename $filedata .gz )
211rm -f $( basename $filedata .gz )
212#
213chmod -R 755 *
214exit
215#
216EOF
217fi
218#------------------------------------------------------------------
219if [ $doSRClodyc -eq 1 ]
220then
221# update src on cerbere
222#
223    echo "iii : update src on cerbere  cerbere"
224    scp job_src_$$ smasson@cerbere.lodyc.jussieu.fr:.
225    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
226fi
227#------------------------------------------------------------------
228if [ $doDTAlodyc -eq 1 ]
229then
230# update data on cerbere
231    echo "iii : update data on cerbere"
232    scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:.
233    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
234fi
235#------------------------------------------------------------------
236if [ $doSRCidris -eq 1 ]
237then
238# update src on rhodes
239    echo "iii : update src to rhodes"
240    scp job_src_$$ reee217@rhodes.idris.fr:.
241    ssh reee217@rhodes.idris.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
242fi
243#------------------------------------------------------------------
244if [ $doDTAidris -eq 1 ]
245then
246# update data on gaya
247    echo "iii : update data to gaya"
248    scp job_data_$$ reee217@gaya.idris.fr:.
249    ssh reee217@gaya.idris.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
250fi
251#------------------------------------------------------------------
252#
253[ -f job_src_$$ ] && rm -f job_src_$$
254[ -f job_data_$$ ] && rm -f
255#
256exit
257#
Note: See TracBrowser for help on using the repository browser.