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