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 |
---|
11 | set -x |
---|
12 | set -u |
---|
13 | # |
---|
14 | dohtml=0 |
---|
15 | dooldtest=0 |
---|
16 | doidldoc_html=1 |
---|
17 | doidldoc_assistant=0 |
---|
18 | doidlwavedoc=0 |
---|
19 | doTARsrc=0 |
---|
20 | doTARdata=0 |
---|
21 | doforge=1 |
---|
22 | doSRClodyc=0 |
---|
23 | doDTAlodyc=0 |
---|
24 | doSRCidris=0 |
---|
25 | doDTAidris=0 |
---|
26 | # |
---|
27 | # |
---|
28 | # get the date in a nice format |
---|
29 | # |
---|
30 | ndate=`date +%Y%m%d` |
---|
31 | # memorize current directory |
---|
32 | memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc |
---|
33 | #------------------------------------------------------------------ |
---|
34 | if [ ${dohtml} -eq 1 ] |
---|
35 | then |
---|
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 |
---|
46 | fi |
---|
47 | #------------------------------------------------------------------ |
---|
48 | if [ ${dooldtest} -eq 1 ] |
---|
49 | then |
---|
50 | # make the old test |
---|
51 | # |
---|
52 | cd ${memopwd}/../../Tests/ |
---|
53 | ./makeold.sh |
---|
54 | exit 0 |
---|
55 | fi |
---|
56 | #------------------------------------------------------------------ |
---|
57 | if [ ${doidlwavedoc} -eq 1 ] |
---|
58 | then |
---|
59 | # |
---|
60 | # redo idlwave doc |
---|
61 | # |
---|
62 | cd ${memopwd}/../ |
---|
63 | Documentation/idlwave_catalog -v -f saxo |
---|
64 | exit 0 |
---|
65 | fi |
---|
66 | #------------------------------------------------------------------ |
---|
67 | if [ ${doidldoc_html} -eq 1 ] |
---|
68 | then |
---|
69 | # |
---|
70 | # build a idl file to launch idldoc |
---|
71 | cat <<EOF > idldoc_html_${$}.pro |
---|
72 | !path = expand_path('+' + '../idldoc/') |
---|
73 | print,!path |
---|
74 | idldoc,root="../../",LOG_FILE="/tmp/idldochtlm_${$}.log", $ |
---|
75 | output="../idldoc_html_output" |
---|
76 | exit |
---|
77 | EOF |
---|
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 |
---|
120 | fi |
---|
121 | #------------------------------------------------------------------ |
---|
122 | if [ ${doidldoc_assistant} -eq 1 ] |
---|
123 | then |
---|
124 | # |
---|
125 | echo "eee : pas encore ecrit" |
---|
126 | exit 1 |
---|
127 | fi |
---|
128 | #------------------------------------------------------------------ |
---|
129 | if [ ${doTARsrc} -eq 1 ] |
---|
130 | then |
---|
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} |
---|
143 | fi |
---|
144 | #------------------------------------------------------------------ |
---|
145 | if [ ${doTARdata} -eq 1 ] |
---|
146 | then |
---|
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} |
---|
158 | fi |
---|
159 | #------------------------------------------------------------------ |
---|
160 | if [ ${doforge} -eq 1 ] |
---|
161 | then |
---|
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}" |
---|
171 | fi |
---|
172 | #------------------------------------------------------------------ |
---|
173 | if [[ ($doSRClodyc -eq 1) || ($doDTAidris -eq 1) ]] |
---|
174 | then |
---|
175 | infosrc=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
176 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
177 | filesrc=$( basename $filesrc ) |
---|
178 | # |
---|
179 | cat <<EOF > job_src_$$ |
---|
180 | #!/bin/bash |
---|
181 | cd SAXO_DIR |
---|
182 | # |
---|
183 | rm -rf SRC |
---|
184 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc |
---|
185 | gunzip $filesrc |
---|
186 | tar xf $( basename $filesrc .gz ) |
---|
187 | rm -f $( basename $filesrc .gz ) |
---|
188 | # |
---|
189 | chmod -R 755 * |
---|
190 | exit |
---|
191 | # |
---|
192 | EOF |
---|
193 | fi |
---|
194 | # |
---|
195 | if [[ ($doDTAlodyc -eq 1) || ($doDTAidris -eq 1) ]] |
---|
196 | then |
---|
197 | infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
198 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
199 | filedata=$(basename $filedata) |
---|
200 | cat <<EOF > job_data_$$ |
---|
201 | #!/bin/bash |
---|
202 | cd SAXO_DIR |
---|
203 | # |
---|
204 | rm -rf DATA |
---|
205 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata |
---|
206 | gunzip $filedata |
---|
207 | tar xf $( basename $filedata .gz ) |
---|
208 | rm -f $( basename $filedata .gz ) |
---|
209 | # |
---|
210 | chmod -R 755 * |
---|
211 | exit |
---|
212 | # |
---|
213 | EOF |
---|
214 | fi |
---|
215 | #------------------------------------------------------------------ |
---|
216 | if [ $doSRClodyc -eq 1 ] |
---|
217 | then |
---|
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_$$" |
---|
223 | fi |
---|
224 | #------------------------------------------------------------------ |
---|
225 | if [ $doDTAlodyc -eq 1 ] |
---|
226 | then |
---|
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_$$" |
---|
231 | fi |
---|
232 | #------------------------------------------------------------------ |
---|
233 | if [ $doSRCidris -eq 1 ] |
---|
234 | then |
---|
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_$$" |
---|
239 | fi |
---|
240 | #------------------------------------------------------------------ |
---|
241 | if [ $doDTAidris -eq 1 ] |
---|
242 | then |
---|
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_$$" |
---|
247 | fi |
---|
248 | #------------------------------------------------------------------ |
---|
249 | # |
---|
250 | [ -f job_src_$$ ] && rm -f job_src_$$ |
---|
251 | [ -f job_data_$$ ] && rm -f |
---|
252 | # |
---|
253 | exit |
---|
254 | # |
---|