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

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

add idldoc html output. see Documentation/idldoc_html_output/index.html

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