[144] | 1 | #!/bin/bash |
---|
[186] | 2 | # |
---|
[123] | 3 | # update : |
---|
| 4 | # $Id$ |
---|
[347] | 5 | # fplod 2008-04-16T12:23:44Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 6 | # add wiki production |
---|
[345] | 7 | # fplod 2008-04-16T09:02:45Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 8 | # html files produced from DocBook files are now produced using makefile |
---|
| 9 | # instead of makehtml.sh |
---|
[262] | 10 | # fplod 2007-08-21T09:29:04Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 11 | # follow changes of calling sequence of pro2href.sh |
---|
| 12 | # add call to pro2href.sh for replacement of <proidl>...</proidl> |
---|
[253] | 13 | # fplod 2007-06-26T14:33:12Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 14 | # copy listings.css in idldoc_assistant_output |
---|
[233] | 15 | # fplod 2007-03-20T15:10:29Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 16 | # . replace <pro>ginette</pro> by a sequence like |
---|
| 17 | # <a href="./ginette.html">ginette</a> in idldoc html and assistant outputs |
---|
| 18 | # . encaspulate example content in <pre> </pre> in idldoc assistant outputs |
---|
[195] | 19 | # smasson Fri Sep 22 17:28:10 CEST 2006 |
---|
| 20 | # check that the number of existing html files for each .pro file is 2! |
---|
[191] | 21 | # fplod 2006-09-21T14:55:09Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 22 | # remove css in idldoc html output (/embed) |
---|
| 23 | # entraine modif de modification de css pour nonproportional font ++ anglais |
---|
| 24 | # fixe is replace by pre and no more css modification |
---|
| 25 | # bug in idldoc html output file idldoc-categories.html |
---|
| 26 | # http://www.w3.org/TR/xhtml1/DTD/xhtml-transitional.dtd |
---|
| 27 | # au lieu de |
---|
| 28 | # http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd |
---|
| 29 | # ++ prévenir l'auteur |
---|
[189] | 30 | # fplod 2006-09-21T13:05:32Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[191] | 31 | # add an svn id in idldoc-lib.adb after </profile> |
---|
[188] | 32 | # fplod 2006-09-20T16:34:38Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 33 | # suppress ?format=raw |
---|
| 34 | # fplod 2006-09-20T15:30:15Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[351] | 35 | # add copy of html files under xmldoc and idldoc_html_output on |
---|
[188] | 36 | # saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ |
---|
| 37 | # see dodocdownload |
---|
[187] | 38 | # fplod 2006-09-20T11:05:23Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[191] | 39 | # correction to really suppress date in idldoc assistant outputs (font |
---|
[187] | 40 | # instaed of div in html output) |
---|
[183] | 41 | # fplod 2006-09-18T13:25:12Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 42 | # add status checking after makehtml.sh |
---|
[182] | 43 | # smasson Fri Sep 15 10:42:01 CEST 2006 |
---|
| 44 | # merge idldoc html and idldoc assistant |
---|
[179] | 45 | # smasson Thu Sep 14 15:19:23 CEST 2006 |
---|
| 46 | # add the revision number in the name of SAXO_SRC_*.tar.gz |
---|
[176] | 47 | # smasson Wed Sep 13 14:18:02 CEST 2006 |
---|
| 48 | # add the directory-overview.html from dir-files.html in idldoc_html_output |
---|
[170] | 49 | # fplod 2006-09-07T08:09:47Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 50 | # main is rename to websaxo |
---|
[168] | 51 | # fplod 2006-09-05T15:39:47Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 52 | # add Source link in idldoc html outpout |
---|
[163] | 53 | # snlod/fplod 2006-08-25T08:30:36Z electre.locean-ipsl.upmc.fr (Darwin) |
---|
| 54 | # add for idldoc assistant |
---|
[156] | 55 | # fplod 2006-08-17T09:19:06Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[183] | 56 | # add transformation after idldoc to force non-proportional font |
---|
[156] | 57 | # on bloc delimited by |
---|
[163] | 58 | # <fixe> |
---|
| 59 | # </fixe> |
---|
[156] | 60 | # in .pro files (with modification of css) |
---|
| 61 | # !! do not replace \ by \\ inside this block |
---|
| 62 | # !! replace \ by an other character is a good idea |
---|
| 63 | # cf. example in ToBeReviewed/TRIANGULATION/definetri.pro |
---|
[144] | 64 | # fplod 2006-07-21T08:23:52Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 65 | # add mini_notice production |
---|
[140] | 66 | # fplod 2006-07-11T08:26:05Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 67 | # commented tidy in dohtml section is moved in makehtml |
---|
[135] | 68 | # fplod 2006-07-10T08:22:53Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 69 | # ajout de white-space: pre; dans la css pour file_comments |
---|
[123] | 70 | # fplod 2006-07-04T13:09:19Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[186] | 71 | # for idldoc html output |
---|
[123] | 72 | # because preformat option doesn't seem to work well |
---|
[186] | 73 | # replace |
---|
[123] | 74 | # div class="value" |
---|
| 75 | # by |
---|
| 76 | # div class="preformat" |
---|
[111] | 77 | # fplod 2006-06-19T08:46:39Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[186] | 78 | # for idldoc html output |
---|
[111] | 79 | #. replace |
---|
| 80 | # -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \ |
---|
| 81 | # -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \ |
---|
[123] | 82 | # -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \ |
---|
[186] | 83 | # by |
---|
[111] | 84 | # -e 's@\(href="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\("\)@\1\2?format=raw\3@g' \ |
---|
| 85 | # -e 's@\(href="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\(#.*"\)@\1\2?format=raw\3@g' \ |
---|
| 86 | #-e 's@\(src="[^.]*[^h]*[^t]*[^m]*[^l]*[^"]*\)\(\.html\)\("\)@\1\2?format=raw\3@g' |
---|
| 87 | # in order to be able to add ?format=raw several time on one line |
---|
[186] | 88 | # . suppress .html in line like |
---|
[111] | 89 | # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html |
---|
| 90 | # in files idldoc-index*.html |
---|
[109] | 91 | # fplod 2006-06-14T12:41:37Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[183] | 92 | # add embed parameter idldoc instructions to try to fix ticket#17 |
---|
[91] | 93 | # fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
[186] | 94 | # add g option in ?format=raw sed transformation in order to fix |
---|
[91] | 95 | # link on top of idldoc like directory-overview.html |
---|
[90] | 96 | # fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 97 | # add ?format=raw in idldoc production for frames |
---|
[89] | 98 | # fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 99 | # add action for idldochtml |
---|
[86] | 100 | # fplod 2006-06-02T14:28:30Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 101 | # modification to produce tar files in /tmp/saxo_${$} when dotar=1 |
---|
| 102 | # modification to copy tar files on http://forge.ipsl.jussieu.fr/saxo/download/ |
---|
| 103 | # when doforge=1 |
---|
| 104 | # produce tar files in /tmp/saxo_${$} when dotar=1 |
---|
| 105 | set -x |
---|
| 106 | set -u |
---|
| 107 | # |
---|
[345] | 108 | docompileall=0 |
---|
| 109 | dohtml=1 |
---|
[86] | 110 | dooldtest=0 |
---|
[321] | 111 | doidlwavedoc=0 |
---|
[327] | 112 | doidldoc=0 |
---|
[116] | 113 | doTARsrc=0 |
---|
[88] | 114 | doTARdata=0 |
---|
[116] | 115 | doforge=0 |
---|
[291] | 116 | doSRClocean=0 |
---|
| 117 | doDTAlocean=0 |
---|
[100] | 118 | doSRCipsl=0 |
---|
| 119 | doDTAipsl=0 |
---|
| 120 | doSRCidris=0 |
---|
| 121 | doDTAidris=0 |
---|
[189] | 122 | dodocdownload=0 |
---|
[86] | 123 | # |
---|
[100] | 124 | case $( whoami ) in |
---|
| 125 | smasson) |
---|
| 126 | lgforge=smasson |
---|
| 127 | ;; |
---|
| 128 | floseb) |
---|
| 129 | lgforge=smasson |
---|
| 130 | ;; |
---|
| 131 | *) |
---|
| 132 | lgforge=saxo |
---|
| 133 | ;; |
---|
| 134 | esac |
---|
[88] | 135 | # |
---|
[100] | 136 | if [ ${lgforge} != smasson ] |
---|
| 137 | then |
---|
[291] | 138 | doSRClocean=0 |
---|
| 139 | doDTAlocean=0 |
---|
[100] | 140 | doSRCipsl=0 |
---|
| 141 | doDTAipsl=0 |
---|
| 142 | doSRCidris=0 |
---|
| 143 | doDTAidris=0 |
---|
[186] | 144 | fi |
---|
[100] | 145 | # |
---|
[88] | 146 | # get the date in a nice format |
---|
| 147 | # |
---|
| 148 | ndate=`date +%Y%m%d` |
---|
[179] | 149 | rev=$( svn info | grep -i revision | awk '{print $NF}' ) |
---|
[86] | 150 | # memorize current directory |
---|
| 151 | memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc |
---|
[100] | 152 | # |
---|
[88] | 153 | #------------------------------------------------------------------ |
---|
[100] | 154 | if [ ${docompileall} -eq 1 ] |
---|
| 155 | then |
---|
| 156 | cat <<EOF > /tmp/compileall${$}.pro |
---|
[186] | 157 | .reset_session |
---|
[114] | 158 | ; |
---|
[100] | 159 | !path = expand_path('+' + '../..') + ':' + expand_path('+' + !dir) |
---|
[115] | 160 | resolve_all, resolve_either='def_myuniquetmpdir', skip_routines = ['xxx2ps','trends', 'label_gmt'] |
---|
| 161 | resolve_all, resolve_either = 'find', skip_routines = ['xxx2ps','trends', 'label_gmt'] |
---|
[114] | 162 | def_myuniquetmpdir |
---|
| 163 | oldcm = find('oldcm_empty') |
---|
| 164 | ;oldcm = find('oldcm_full') |
---|
| 165 | oldcm = oldcm[0] |
---|
| 166 | @cm_general |
---|
| 167 | file_copy, oldcm, myuniquetmpdir + 'oldcm_used.pro', /overwrite |
---|
[239] | 168 | !path = myuniquetmpdir + ':' + !path |
---|
[114] | 169 | IF !journal NE 0 THEN journal |
---|
| 170 | journal, myuniquetmpdir + 'cm_demomode_used.pro' |
---|
[186] | 171 | journal |
---|
[239] | 172 | path_cache, /rebuild |
---|
[114] | 173 | ; |
---|
[115] | 174 | resolve_all, resolve_either='keep_compatibility', skip_routines = ['xxx2ps','trends', 'label_gmt'] |
---|
[114] | 175 | ; |
---|
[100] | 176 | EOF |
---|
| 177 | # |
---|
[324] | 178 | for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt | grep -iv report ) |
---|
[100] | 179 | do |
---|
[115] | 180 | # does it contains pro or function ? |
---|
[233] | 181 | egrep -iq '^ * *(pro|function)' ${i} |
---|
| 182 | if [ ${?} -eq 0 ] |
---|
[100] | 183 | then |
---|
[233] | 184 | echo "print, '$( basename ${i} .pro ) :'" >> /tmp/compileall${$}.pro |
---|
[324] | 185 | echo "resolve_all, resolve_either = '$( basename ${i} .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt', 'report']" >> /tmp/compileall${$}.pro |
---|
[100] | 186 | fi |
---|
| 187 | done |
---|
[291] | 188 | echo "exit" >> /tmp/compileall${$}.pro |
---|
[100] | 189 | IDL_STARTUP=/tmp/compileall${$}.pro |
---|
[120] | 190 | ${IDL_DIR}/bin/idl &> /tmp/compileallerr_${$} |
---|
[100] | 191 | echo |
---|
| 192 | echo |
---|
[114] | 193 | grep -i "error" /tmp/compileallerr_${$} |
---|
| 194 | # grep -q "Compilation error(s)" /tmp/compileallerr_${$} |
---|
[186] | 195 | if [ ${?} -ne 0 ] |
---|
[105] | 196 | then |
---|
| 197 | echo "ALL SAXO files are OK..." |
---|
| 198 | rm -f /tmp/compileallerr_${$} /tmp/compileall${$}.pro |
---|
| 199 | else |
---|
| 200 | grep "Compilation error(s)" /tmp/compileallerr_${$} |
---|
| 201 | echo "eee : see /tmp/compileallerr_${$}" |
---|
[115] | 202 | more /tmp/compileallerr_${$} |
---|
[105] | 203 | exit 1 |
---|
| 204 | fi |
---|
[100] | 205 | echo |
---|
| 206 | echo |
---|
| 207 | fi |
---|
| 208 | #------------------------------------------------------------------ |
---|
[86] | 209 | if [ ${dohtml} -eq 1 ] |
---|
| 210 | then |
---|
| 211 | # |
---|
[347] | 212 | # redo the html and wiki files |
---|
[86] | 213 | # |
---|
| 214 | cd ${memopwd} |
---|
[345] | 215 | make clean |
---|
[347] | 216 | make all |
---|
[345] | 217 | make dbkcheck |
---|
[86] | 218 | fi |
---|
[88] | 219 | #------------------------------------------------------------------ |
---|
[86] | 220 | if [ ${dooldtest} -eq 1 ] |
---|
| 221 | then |
---|
| 222 | # make the old test |
---|
| 223 | # |
---|
| 224 | cd ${memopwd}/../../Tests/ |
---|
| 225 | ./makeold.sh |
---|
| 226 | exit 0 |
---|
| 227 | fi |
---|
[88] | 228 | #------------------------------------------------------------------ |
---|
[86] | 229 | if [ ${doidlwavedoc} -eq 1 ] |
---|
| 230 | then |
---|
| 231 | # |
---|
| 232 | # redo idlwave doc |
---|
| 233 | # |
---|
[107] | 234 | cd ${memopwd}/../.. |
---|
[86] | 235 | Documentation/idlwave_catalog -v -f saxo |
---|
| 236 | exit 0 |
---|
| 237 | fi |
---|
[88] | 238 | #------------------------------------------------------------------ |
---|
[182] | 239 | if [ ${doidldoc} -eq 1 ] |
---|
[86] | 240 | then |
---|
| 241 | # |
---|
[89] | 242 | # build a idl file to launch idldoc |
---|
[111] | 243 | output=../idldoc_html_output/ |
---|
[233] | 244 | log="/tmp/idldochtml_${$}.log" |
---|
| 245 | pro="/tmp/idldochtml_${$}.pro" |
---|
[111] | 246 | cat <<EOF > ${pro} |
---|
[89] | 247 | !path = expand_path('+' + '../idldoc/') |
---|
| 248 | print,!path |
---|
[111] | 249 | idldoc,root="../../",title="SAXO Documentation", $ |
---|
| 250 | LOG_FILE="${log}", $ |
---|
[163] | 251 | output="${output}", $ |
---|
[191] | 252 | overview="../../overview", /statistics, /preformat |
---|
[89] | 253 | exit |
---|
| 254 | EOF |
---|
| 255 | # launch idl with the file built above |
---|
[120] | 256 | IDL_STARTUP=${pro};${IDL_DIR}/bin/idl |
---|
[111] | 257 | /bin/rm ${pro} |
---|
[89] | 258 | # In order to do not have to many revision in svn, we modify some |
---|
| 259 | # lines produced by idldoc : |
---|
[191] | 260 | # - add Source link in each html file corresponding to a .pro file |
---|
[168] | 261 | # example : |
---|
| 262 | # <td>Source</td> |
---|
| 263 | # will be replaced by |
---|
[188] | 264 | # <td><a href="../../Calendar/caldat.pro" title="Source code of a file">Source</a></td> |
---|
[168] | 265 | # |
---|
| 266 | # - remove date and time of idldoc production |
---|
[89] | 267 | # examples : |
---|
| 268 | # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> |
---|
| 269 | # will be replaced by |
---|
| 270 | # <!-- Generated by IDLdoc 2.0 --> |
---|
| 271 | # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun 7 10:54:37 2006.</div |
---|
| 272 | # will be replaced by |
---|
| 273 | # <div id="tagline">Produced by IDLdoc 2.0</div> |
---|
| 274 | # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> |
---|
[186] | 275 | # will be delete |
---|
| 276 | # other lines will be deleted because the time is the time of checkout not |
---|
[89] | 277 | # the time of revision. |
---|
| 278 | # the sequence of lines |
---|
| 279 | #<dl> |
---|
| 280 | # <dt>Last modification:</dt> |
---|
| 281 | # <dd>Fri Jun 2 11:46:24 2006</dd> |
---|
| 282 | # </dl> |
---|
| 283 | # should also be removed ++ je ne sais pas dire en sed la ligne |
---|
| 284 | # suivant l'occurence de Last modification |
---|
[191] | 285 | # |
---|
[168] | 286 | # count of directory levels in output |
---|
[233] | 287 | # this count will be use to format relative path later |
---|
[168] | 288 | nblev1=$(echo ${output} | sed -e "s@/\$@@" |awk -F "/" '{print NF}') |
---|
| 289 | # |
---|
[233] | 290 | list_html_pro=$(find ${output} -name "*.html" -exec grep -l "<title>.*\.pro" {} \;) |
---|
[191] | 291 | for file_html in ${list_html_pro} |
---|
[89] | 292 | do |
---|
[183] | 293 | # build the .pro file name |
---|
[168] | 294 | bfile=$(basename ${file_html} .html) |
---|
| 295 | # retrieve the path of html file relative to memopwd (so relative to |
---|
| 296 | # output). This path will be used in "Source" link. |
---|
| 297 | nblev2=$(dirname ${file_html} | sed -e "s@/\$@@" | awk -F "/" '{print NF}') |
---|
| 298 | difflev=$((${nblev2} - ${nblev1})) |
---|
| 299 | if [ ${difflev} -ge 2 ] |
---|
| 300 | then |
---|
| 301 | ilev=1 |
---|
| 302 | reloutput_html=".." |
---|
| 303 | while [ ${ilev} -le ${difflev} ] |
---|
| 304 | do |
---|
| 305 | reloutput_html="${reloutput_html}/.." |
---|
| 306 | ilev=$(( ${ilev} + 1 )) |
---|
| 307 | done |
---|
| 308 | relpath_html=$(dirname ${file_html} | \ |
---|
| 309 | sed -e "s@${output}@${reloutput_html}@" \ |
---|
| 310 | -e "s@\$@/@") |
---|
[233] | 311 | # echo "relpath ${relpath_html})" |
---|
[168] | 312 | else |
---|
| 313 | relpath_html="./" |
---|
| 314 | fi |
---|
| 315 | # echo "relpath ${relpath_html}/${bfile}" |
---|
[89] | 316 | sed \ |
---|
[188] | 317 | -e "s@<td >Source<\/td>@<td><a href=\"${relpath_html}/${bfile}.pro\" title=\"Source code of a file\">Source<\/a><\/td>@" \ |
---|
[191] | 318 | ${file_html} > ${file_html}_modify |
---|
| 319 | mv ${file_html}_modify ${file_html} |
---|
| 320 | done |
---|
| 321 | list_html=$(find ${output} -name "*.html") |
---|
| 322 | for file_html in ${list_html} |
---|
| 323 | do |
---|
| 324 | sed \ |
---|
[89] | 325 | -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ |
---|
| 326 | -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \ |
---|
| 327 | -e "/<h2>Produced on/d" \ |
---|
| 328 | -e "/Last modification:/d" \ |
---|
| 329 | -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ |
---|
[123] | 330 | -e 's@<div class="value">@<div class="preformat">@' \ |
---|
[135] | 331 | -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \ |
---|
[191] | 332 | -e 's@^ <fixe>@<pre>@' \ |
---|
| 333 | -e 's@^ </fixe>@</pre>@' \ |
---|
| 334 | -e 's@xhtml-transitional@xhtml1-transitional@' \ |
---|
[89] | 335 | ${file_html} > ${file_html}_modify |
---|
| 336 | mv ${file_html}_modify ${file_html} |
---|
| 337 | done |
---|
[111] | 338 | # suppress ".html" in idldoc-index*.html in lines like |
---|
| 339 | # a parameter from the routine ./ReadWrite/idl-NetCDF/ncdf_read.html |
---|
| 340 | list_html=$(find ${output} -name "idldoc-index*.html") |
---|
| 341 | for file_html in ${list_html} |
---|
| 342 | do |
---|
| 343 | sed \ |
---|
| 344 | -e "s/\(a parameter from the routine \)\(.*\)\(.html\)/\1\2/" \ |
---|
| 345 | ${file_html} > ${file_html}_modify |
---|
| 346 | mv ${file_html}_modify ${file_html} |
---|
| 347 | done |
---|
[233] | 348 | # replace <pro>ginette</pro> by a sequence like |
---|
| 349 | # <a href="./ginette.html">ginette</a> |
---|
[262] | 350 | ./pro2href.sh -i ${output} -r ${output} -e pro |
---|
[233] | 351 | status=${?} |
---|
| 352 | if [ ${status} -ne 0 ] |
---|
| 353 | then |
---|
[262] | 354 | echo "eee : pb during ./pro2href.sh for <pro>...</pro>" |
---|
[233] | 355 | exit 1 |
---|
| 356 | fi |
---|
[262] | 357 | # replace <proidl>ginette</proidl> by a sequence like |
---|
| 358 | # <a href="./ginette.html">ginette</a> |
---|
| 359 | ./pro2href.sh -i ${output} -r ${IDL_DIR}/help/online_help -e proidl |
---|
| 360 | status=${?} |
---|
| 361 | if [ ${status} -ne 0 ] |
---|
| 362 | then |
---|
| 363 | echo "eee : pb during ./pro2href.sh for <proidl>...</proidl>" |
---|
| 364 | exit 1 |
---|
| 365 | fi |
---|
[111] | 366 | echo "iii : you can see log file in ${log}" |
---|
| 367 | echo "iii : and look ${output}/idldoc-warnings.html#undoc" |
---|
[86] | 368 | # |
---|
[163] | 369 | # build a idl file to launch idldoc |
---|
| 370 | output=../idldoc_assistant_output/ |
---|
| 371 | log="/tmp/idldocassistant_${$}.log" |
---|
| 372 | pro="/tmp/idldocassistant_${$}.pro" |
---|
| 373 | cat <<EOF > ${pro} |
---|
| 374 | !path = expand_path('+' + '../idldoc/') |
---|
| 375 | print,!path |
---|
| 376 | idldoc,root="../../",title="SAXO Documentation Assistant", $ |
---|
| 377 | LOG_FILE="${log}", $ |
---|
| 378 | output="${output}", overview='../../overview', /statistics, /preformat, /embed, /assistant |
---|
| 379 | exit |
---|
| 380 | EOF |
---|
| 381 | # launch idl with the file built above |
---|
| 382 | IDL_STARTUP=${pro};${IDL_DIR}/bin/idl |
---|
| 383 | /bin/rm ${pro} |
---|
| 384 | # In order to do not have to many revision in svn, we modify some |
---|
| 385 | # lines produced by idldoc : |
---|
| 386 | # examples : |
---|
| 387 | # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> |
---|
| 388 | # will be replaced by |
---|
| 389 | # <!-- Generated by IDLdoc 2.0 --> |
---|
[187] | 390 | # <p><font color="gray" size="-3"> Produced by IDLdoc 2.0 on Wed Sep 13 16:32:10 2006.</font></p> |
---|
[163] | 391 | # will be replaced by |
---|
[187] | 392 | # <p><font color="gray" size="-3"> Produced by IDLdoc 2.0</font></p> |
---|
[163] | 393 | # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> |
---|
[186] | 394 | # will be delete |
---|
| 395 | # other lines will be deleted because the time is the time of checkout not |
---|
[163] | 396 | # the time of revision. |
---|
| 397 | # the sequence of lines |
---|
| 398 | #<dl> |
---|
| 399 | # <dt>Last modification:</dt> |
---|
| 400 | # <dd>Fri Jun 2 11:46:24 2006</dd> |
---|
| 401 | # </dl> |
---|
| 402 | # should also be removed ++ je ne sais pas dire en sed la ligne |
---|
| 403 | # suivant l'occurence de Last modification |
---|
| 404 | # replace *_param_* in href attributes because anchors are badly written |
---|
| 405 | # with _keyword_ |
---|
| 406 | #++ -e 's@\(href="#_.*\)\(_param_\)\(.*"\)@\1_keyword_\3@g' \ # ++ pb global |
---|
| 407 | # ONLINE_HELP, book="../idldoc_assistant_output/idldoc-lib.adp", /full_path # won't work |
---|
[233] | 408 | # encaspulate example content in <pre> </pre> in idldoc assistant outputs |
---|
| 409 | # Examples section is supposed to start with <h3>Examples</h3> |
---|
| 410 | # and end is before <h3>Version history</h3> |
---|
[163] | 411 | list_html=$(find ${output} -name "*.html") |
---|
| 412 | for file_html in ${list_html} |
---|
| 413 | do |
---|
| 414 | sed \ |
---|
| 415 | -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ |
---|
[187] | 416 | -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \ |
---|
[163] | 417 | -e "/<h2>Produced on/d" \ |
---|
| 418 | -e "/Last modification:/d" \ |
---|
| 419 | -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ |
---|
| 420 | -e '/href/s@_param_@_keyword_@g' \ |
---|
| 421 | -e 's@<div class="value">@<div class="preformat">@' \ |
---|
| 422 | -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \ |
---|
[191] | 423 | -e 's@^ <fixe>@<pre>@' \ |
---|
[163] | 424 | -e 's@^ </fixe>@</pre>@' \ |
---|
[233] | 425 | -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \ |
---|
| 426 | -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \ |
---|
[163] | 427 | ${file_html} > ${file_html}_modify |
---|
| 428 | mv ${file_html}_modify ${file_html} |
---|
| 429 | done |
---|
[233] | 430 | # replace <pro>ginette</pro> by a sequence like |
---|
| 431 | # <a href="./ginette.html">ginette</a> |
---|
[262] | 432 | ./pro2href.sh -i ${output} -r ${output} -e pro |
---|
[233] | 433 | status=${?} |
---|
| 434 | if [ ${status} -ne 0 ] |
---|
| 435 | then |
---|
[262] | 436 | echo "eee : pb during ./pro2href.sh for <pro>...</pro>" |
---|
[233] | 437 | exit 1 |
---|
| 438 | fi |
---|
[262] | 439 | # replace <proidl>ginette</proidl> by a sequence like |
---|
| 440 | # <a href="./ginette.html">ginette</a> |
---|
| 441 | ./pro2href.sh -i ${output} -r ${IDL_DIR}/help/online_help -e proidl |
---|
| 442 | status=${?} |
---|
| 443 | if [ ${status} -ne 0 ] |
---|
| 444 | then |
---|
| 445 | echo "eee : pb during ./pro2href.sh for <proidl>...</proidl>" |
---|
| 446 | exit 1 |
---|
| 447 | fi |
---|
[176] | 448 | # add the directory-overview.html from dir-files.html in idldoc_html_output |
---|
| 449 | list_html=$(find ../idldoc_html_output -name dir-files.html) |
---|
| 450 | for file_html in ${list_html} |
---|
| 451 | do |
---|
| 452 | fout=../idldoc_assistant_output/${file_html#../idldoc_html_output/*} |
---|
[186] | 453 | fout=${fout%/*}/directory-overview.html |
---|
[188] | 454 | cp ${file_html} ${fout} |
---|
[176] | 455 | done |
---|
[253] | 456 | # copy listings.css (needed by directory-overview.html files) |
---|
| 457 | cp ../idldoc/resource/listings.css ${output} |
---|
[189] | 458 | # add an id in idldoc-lib.adp |
---|
| 459 | cat << EOF > /tmp/adp_modification |
---|
| 460 | <!-- \$Id\$ --> |
---|
| 461 | EOF |
---|
[191] | 462 | sed -e "/<\/profile>/r /tmp/adp_modification" \ |
---|
[189] | 463 | ../idldoc_assistant_output/idldoc-lib.adp > \ |
---|
| 464 | ../idldoc_assistant_output/idldoc-lib.adp_${$} |
---|
| 465 | mv ../idldoc_assistant_output/idldoc-lib.adp_${$} \ |
---|
| 466 | ../idldoc_assistant_output/idldoc-lib.adp |
---|
| 467 | rm /tmp/adp_modification |
---|
[163] | 468 | echo "iii : you can see log file in ${log}" |
---|
| 469 | echo "iii : and look ${output}/idldoc-warnings.html#undoc" |
---|
[195] | 470 | # check that the number of existing html files for each .pro file is 2! |
---|
| 471 | for i in $( find ../.. -name "*.pro" ) |
---|
[233] | 472 | do |
---|
| 473 | nhtml=$( find ../.. -name $( basename ${i} .pro ).html | wc -l ) |
---|
| 474 | if [ ${nhtml} -ne 2 ] |
---|
[195] | 475 | then |
---|
[291] | 476 | echo "ERROR there is not 2 $( basename ${i} .pro ).html files" |
---|
[233] | 477 | find ../.. -name $( basename ${i} .pro ).html |
---|
[195] | 478 | echo |
---|
| 479 | fi |
---|
| 480 | done |
---|
[86] | 481 | fi |
---|
[88] | 482 | #------------------------------------------------------------------ |
---|
| 483 | if [ ${doTARsrc} -eq 1 ] |
---|
[86] | 484 | then |
---|
| 485 | localtarbase=/tmp/savesaxo_${$} |
---|
| 486 | mkdir ${localtarbase}/ |
---|
[87] | 487 | # clean backup files : *~ |
---|
[88] | 488 | find ${memopwd}/../../.. -name "*~" -exec rm {} \; |
---|
[87] | 489 | # prepare the source tar (without the svn...) |
---|
[86] | 490 | # |
---|
[87] | 491 | cd ${memopwd}/../../.. |
---|
[179] | 492 | tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC |
---|
[86] | 493 | # |
---|
[87] | 494 | # informations |
---|
[89] | 495 | echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" |
---|
[87] | 496 | ls -l ${localtarbase} |
---|
| 497 | fi |
---|
[88] | 498 | #------------------------------------------------------------------ |
---|
| 499 | if [ ${doTARdata} -eq 1 ] |
---|
[87] | 500 | then |
---|
| 501 | localtarbase=/tmp/savesaxo_${$} |
---|
| 502 | mkdir ${localtarbase}/ |
---|
[86] | 503 | # |
---|
[87] | 504 | # prepare the data tar (without the svn...) |
---|
| 505 | # |
---|
| 506 | cd ${memopwd}/../../.. |
---|
| 507 | tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz --exclude .svn DATA |
---|
| 508 | # |
---|
[86] | 509 | # informations |
---|
[89] | 510 | echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" |
---|
[86] | 511 | ls -l ${localtarbase} |
---|
| 512 | fi |
---|
[88] | 513 | #------------------------------------------------------------------ |
---|
[86] | 514 | if [ ${doforge} -eq 1 ] |
---|
| 515 | then |
---|
[100] | 516 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" |
---|
[88] | 517 | if [ ${doTARsrc} -ne 1 ] |
---|
[86] | 518 | then |
---|
[89] | 519 | localtarbase=${1} |
---|
[86] | 520 | fi |
---|
[100] | 521 | scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ |
---|
[86] | 522 | echo "iii : do not forget to update getsaxo.html" |
---|
[345] | 523 | echo "iii : \$ make ./getsaxo.html" |
---|
[86] | 524 | echo "iii : do not forget to clean ${localtarbase}" |
---|
| 525 | fi |
---|
[88] | 526 | #------------------------------------------------------------------ |
---|
[291] | 527 | if [[ (${doDTAlocean} -eq 1) || (${doDTAipsl} -eq 1) ]] |
---|
[88] | 528 | then |
---|
[100] | 529 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" |
---|
| 530 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
| 531 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
[233] | 532 | filedata=$(basename ${filedata}) |
---|
[88] | 533 | cat <<EOF > job_data_$$ |
---|
[100] | 534 | #!/bin/bash |
---|
[88] | 535 | cd SAXO_DIR |
---|
[86] | 536 | # |
---|
[88] | 537 | rm -rf DATA |
---|
[233] | 538 | wget http://forge.ipsl.jussieu.fr/saxo/download/${filedata} |
---|
| 539 | gunzip ${filedata} |
---|
| 540 | tar vxf $( basename ${filedata} .gz ) |
---|
| 541 | rm -f $( basename ${filedata} .gz ) |
---|
[88] | 542 | # |
---|
| 543 | chmod -R 755 * |
---|
| 544 | exit |
---|
| 545 | # |
---|
[86] | 546 | EOF |
---|
[88] | 547 | fi |
---|
| 548 | #------------------------------------------------------------------ |
---|
[291] | 549 | if [ ${doSRClocean} -eq 1 ] |
---|
[88] | 550 | then |
---|
| 551 | # update src on cerbere |
---|
[86] | 552 | # |
---|
[100] | 553 | echo "iii : update src on cerbere" |
---|
[304] | 554 | ssh smasson@cerbere.locean-ipsl.upmc.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" |
---|
[88] | 555 | fi |
---|
| 556 | #------------------------------------------------------------------ |
---|
[291] | 557 | if [ ${doDTAlocean} -eq 1 ] |
---|
[88] | 558 | then |
---|
| 559 | # update data on cerbere |
---|
| 560 | echo "iii : update data on cerbere" |
---|
[304] | 561 | scp job_data_$$ smasson@cerbere.locean-ipsl.upmc.fr:. |
---|
| 562 | ssh smasson@cerbere.locean-ipsl.upmc.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" |
---|
[88] | 563 | fi |
---|
| 564 | #------------------------------------------------------------------ |
---|
[233] | 565 | if [ ${doSRCipsl} -eq 1 ] |
---|
[100] | 566 | then |
---|
[116] | 567 | # update src on calcul2 |
---|
[100] | 568 | # |
---|
[116] | 569 | echo "iii : update src on calcul2" |
---|
| 570 | ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" |
---|
[100] | 571 | fi |
---|
| 572 | #------------------------------------------------------------------ |
---|
[233] | 573 | if [ ${doDTAipsl} -eq 1 ] |
---|
[100] | 574 | then |
---|
| 575 | # update data on cook |
---|
| 576 | echo "iii : update data on cook" |
---|
| 577 | scp job_data_$$ smlod@cook.ipsl.jussieu.fr:. |
---|
| 578 | ssh smlod@cook.ipsl.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" |
---|
| 579 | fi |
---|
| 580 | #------------------------------------------------------------------ |
---|
[233] | 581 | if [ ${doSRCidris} -eq 1 ] |
---|
[88] | 582 | then |
---|
| 583 | # update src on rhodes |
---|
| 584 | echo "iii : update src to rhodes" |
---|
[209] | 585 | ssh -t smasson@cerbere.locean-ipsl.upmc.fr ssh reee217@rhodes.idris.fr "/usr/local/pub/svn/svn-1.3.1/bin/svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" |
---|
[88] | 586 | fi |
---|
| 587 | #------------------------------------------------------------------ |
---|
[233] | 588 | if [ ${doDTAidris} -eq 1 ] |
---|
[88] | 589 | then |
---|
[100] | 590 | # create the update script for rhodes |
---|
[291] | 591 | if [[ (${doDTAlocean} -eq 0) && (${doDTAipsl} -eq 0) ]] |
---|
[100] | 592 | then |
---|
| 593 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" |
---|
| 594 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
| 595 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
[233] | 596 | filedata=$(basename ${filedata}) |
---|
[100] | 597 | fi |
---|
| 598 | cat <<EOF > job_data_idris_$$ |
---|
| 599 | #!/bin/ksh |
---|
| 600 | cd SAXO_DIR |
---|
| 601 | # |
---|
| 602 | rm -rf DATA |
---|
| 603 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" |
---|
[233] | 604 | scp ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/${filedata} . |
---|
| 605 | gunzip ${filedata} |
---|
| 606 | tar vxf $( basename ${filedata} .gz ) |
---|
| 607 | rm -f $( basename ${filedata} .gz ) |
---|
[100] | 608 | # |
---|
| 609 | chmod -R 755 * |
---|
| 610 | exit |
---|
| 611 | # |
---|
| 612 | EOF |
---|
[88] | 613 | # update data on gaya |
---|
| 614 | echo "iii : update data to gaya" |
---|
[100] | 615 | scp job_data_idris_$$ reee217@gaya.idris.fr:. |
---|
| 616 | ssh reee217@gaya.idris.fr "chmod 755 job_data_idris_$$ ; ./job_data_idris_$$ ; rm -f job_data_idris_$$" |
---|
[88] | 617 | fi |
---|
| 618 | #------------------------------------------------------------------ |
---|
[188] | 619 | if [ ${dodocdownload} -eq 1 ] |
---|
| 620 | then |
---|
| 621 | # ++ on pourrait peut-etre faire un rsync en enlevant les .sh et le .xsl |
---|
[189] | 622 | # et faire le ménage des fichiers qui n'existent plus |
---|
[188] | 623 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd several times" |
---|
| 624 | # |
---|
| 625 | # copy files in a temporary directory |
---|
| 626 | mkdir /tmp/download_${$}/ |
---|
[197] | 627 | cp -rp ../xmldoc /tmp/download_${$}/ |
---|
[188] | 628 | cp -rp ../idldoc_html_output /tmp/download_${$}/ |
---|
| 629 | # |
---|
| 630 | # remove svn files |
---|
| 631 | find /tmp/download_${$}/ -name ".svn" -exec rm -rf {} \; |
---|
| 632 | # |
---|
[191] | 633 | # replace relative path |
---|
[189] | 634 | # by http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/ |
---|
[191] | 635 | # on ulink lines containing some directories like ../../ToBeReviewed/ or ../../Test/ or file like newheader.txt |
---|
[188] | 636 | list_html=$(find /tmp/download_${$}/ -name "*.html") |
---|
| 637 | for file_html in ${list_html} |
---|
| 638 | do |
---|
[191] | 639 | sed \ |
---|
| 640 | -e "/Source code of a file/s+../.*/../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \ |
---|
| 641 | -e "/..\/..\/ToBeReviewed/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \ |
---|
| 642 | -e "/..\/..\/Test/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \ |
---|
| 643 | -e "/..\/..\/Calendar/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+" \ |
---|
| 644 | -e "/..\/newheader/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/Documentation/+" \ |
---|
| 645 | ${file_html} > ${file_html}_${$} |
---|
| 646 | mv ${file_html}_${$} ${file_html} |
---|
[188] | 647 | done |
---|
[197] | 648 | echo |
---|
[291] | 649 | echo "give SAXO password if asked" |
---|
[197] | 650 | scp -rp /tmp/download_${$}/* saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ |
---|
[188] | 651 | rm -rf /tmp/download_${$}/ |
---|
| 652 | fi |
---|
| 653 | #------------------------------------------------------------------ |
---|
| 654 | #------------------------------------------------------------------ |
---|
[86] | 655 | # |
---|
[88] | 656 | [ -f job_src_$$ ] && rm -f job_src_$$ |
---|
[100] | 657 | [ -f job_data_$$ ] && rm -f job_data_$$ |
---|
| 658 | [ -f job_data_idris_$$ ] && rm -f job_data_idris_$$ |
---|
[86] | 659 | # |
---|
[88] | 660 | exit |
---|
[86] | 661 | # |
---|