Changeset 430 for trunk/SRC/Documentation/xmldoc/savesaxo.sh
- Timestamp:
- 04/15/10 15:13:55 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/xmldoc/savesaxo.sh
r425 r430 161 161 # 162 162 case $( whoami ) in 163 164 165 166 167 168 169 170 171 163 smasson) 164 lgforge=smasson 165 ;; 166 floseb) 167 lgforge=smasson 168 ;; 169 *) 170 lgforge=saxo 171 ;; 172 172 esac 173 173 # 174 174 if [ ${lgforge} != smasson ] 175 175 then 176 177 178 179 180 181 176 doSRClocean=0 177 doDTAlocean=0 178 doSRCipsl=0 179 doDTAipsl=0 180 doSRCidris=0 181 doDTAidris=0 182 182 fi 183 183 # … … 191 191 #------------------------------------------------------------------ 192 192 if [ ${docompileall} -eq 1 ] 193 194 193 then 194 cat <<EOF > /tmp/compileall${$}.pro 195 195 .reset_session 196 196 ; … … 214 214 EOF 215 215 # 216 217 218 # does it contains pro or function ?216 for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt | grep -iv report ) 217 do 218 # does it contains pro or function ? 219 219 egrep -iq '^ * *(pro|function)' ${i} 220 220 if [ ${?} -eq 0 ] 221 222 223 221 then 222 echo "print, '$( basename ${i} .pro ) :'" >> /tmp/compileall${$}.pro 223 echo "resolve_all, resolve_either = '$( basename ${i} .pro )', skip_routines = ['xxx2ps','trends', 'label_gmt', 'report']" >> /tmp/compileall${$}.pro 224 224 fi 225 226 227 228 229 230 231 232 #grep -q "Compilation error(s)" /tmp/compileallerr_${$}233 234 235 echo "ALL SAXO files are OK..."236 rm -f /tmp/compileallerr_${$} /tmp/compileall${$}.pro237 238 grep "Compilation error(s)" /tmp/compileallerr_${$}239 echo "eee : see /tmp/compileallerr_${$}"240 more /tmp/compileallerr_${$}241 exit 1242 243 244 225 done 226 echo "exit" >> /tmp/compileall${$}.pro 227 IDL_STARTUP=/tmp/compileall${$}.pro 228 ${idl_dir}/bin/idl &> /tmp/compileallerr_${$} 229 echo 230 echo 231 grep -i "error" /tmp/compileallerr_${$} 232 # grep -q "Compilation error(s)" /tmp/compileallerr_${$} 233 if [ ${?} -ne 0 ] 234 then 235 echo "ALL SAXO files are OK..." 236 rm -f /tmp/compileallerr_${$} /tmp/compileall${$}.pro 237 else 238 grep "Compilation error(s)" /tmp/compileallerr_${$} 239 echo "eee : see /tmp/compileallerr_${$}" 240 more /tmp/compileallerr_${$} 241 exit 1 242 fi 243 echo 244 echo 245 245 fi 246 246 #------------------------------------------------------------------ 247 247 if [ ${dohtml} -eq 1 ] 248 248 then 249 #250 # redo the HTML files251 #252 253 254 249 # 250 # redo the HTML files 251 # 252 cd ${memopwd} 253 make clean 254 make html 255 255 fi 256 256 #------------------------------------------------------------------ 257 257 if [ ${dowiki} -eq 1 ] 258 258 then 259 #260 # redo the WIKI files261 #262 263 264 259 # 260 # redo the WIKI files 261 # 262 cd ${memopwd} 263 make clean 264 make tracwiki 265 265 fi 266 266 #------------------------------------------------------------------ 267 267 if [ ${dooldtest} -eq 1 ] 268 268 then 269 # make the old test270 #271 272 273 269 # make the old test 270 # 271 cd ${memopwd}/../../Tests/ 272 ./makeold.sh 273 exit 0 274 274 fi 275 275 #------------------------------------------------------------------ 276 276 if [ ${doidlwavedoc} -eq 1 ] 277 277 then 278 #279 # redo idlwave doc280 #281 282 283 278 # 279 # redo idlwave doc 280 # 281 cd ${memopwd}/../.. 282 Documentation/idlwave_catalog -v -f saxo 283 exit 0 284 284 fi 285 285 #------------------------------------------------------------------ 286 286 if [ ${doidldoc} -eq 1 ] 287 287 then 288 289 290 291 -i ../.. -t "SAXO Documentation" \292 -o ../idldoc_html_output/293 -idl_dir ${idl_dir}294 -e pro -r ../idldoc_html_output/ \295 -e proidl -r /usr/local_linux/idl/idl_6.4/idl/help/online_help296 297 298 299 echo "eee : pb with doidldoc html"300 exit 1301 302 303 304 305 306 307 288 # 289 # build HTML idldoc outputs 290 ${SAXO_DIR}/SRC/Documentation/xmldoc/doidldoc.sh \ 291 -i ../.. -t "SAXO Documentation" \ 292 -o ../idldoc_html_output/ 293 -idl_dir ${idl_dir} 294 -e pro -r ../idldoc_html_output/ \ 295 -e proidl -r /usr/local_linux/idl/idl_6.4/idl/help/online_help 296 doidldoc_html=${?} 297 if [ ${doidldoc_html} -ne 0 ] 298 then 299 echo "eee : pb with doidldoc html" 300 exit 1 301 fi 302 # 303 # build a idl file to launch idldoc 304 output=../idldoc_assistant_output/ 305 log="/tmp/idldocassistant_${$}.log" 306 pro="/tmp/idldocassistant_${$}.pro" 307 cat <<EOF > ${pro} 308 308 !path = expand_path('+' + '../idldoc/') 309 309 print,!path … … 313 313 exit 314 314 EOF 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 sed \349 -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \350 -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \351 -e "/<h2>Produced on/d" \352 -e "/Last modification:/d" \353 -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \354 -e '/href/s@_param_@_keyword_@g' \355 -e 's@<div class="value">@<div class="preformat">@' \356 -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \357 -e 's@^ <fixe>@<pre>@' \358 -e 's@^ </fixe>@</pre>@' \359 -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \360 -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \361 ${file_html} > ${file_html}_modify362 mv ${file_html}_modify ${file_html}363 364 365 366 367 368 369 370 371 372 373 374 375 ./pro2href.sh-i ${output} -r ${idl_dir}/help/online_help -e proidl376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 315 # launch idl with the file built above 316 IDL_STARTUP=${pro};${idl_dir}/bin/idl 317 /bin/rm ${pro} 318 # In order to do not have to many revision in svn, we modify some 319 # lines produced by idldoc : 320 # examples : 321 # <!-- Generated by IDLdoc 2.0 on Wed Jun 7 10:25:28 2006 --> 322 # will be replaced by 323 # <!-- Generated by IDLdoc 2.0 --> 324 # <p><font color="gray" size="-3"> Produced by IDLdoc 2.0 on Wed Sep 13 16:32:10 2006.</font></p> 325 # will be replaced by 326 # <p><font color="gray" size="-3"> Produced by IDLdoc 2.0</font></p> 327 # <h2>Produced on Wed Jun 7 10:23:13 2006</h2> 328 # will be delete 329 # other lines will be deleted because the time is the time of checkout not 330 # the time of revision. 331 # the sequence of lines 332 #<dl> 333 # <dt>Last modification:</dt> 334 # <dd>Fri Jun 2 11:46:24 2006</dd> 335 # </dl> 336 # should also be removed ++ je ne sais pas dire en sed la ligne 337 # suivant l'occurence de Last modification 338 # replace *_param_* in href attributes because anchors are badly written 339 # with _keyword_ 340 #++ -e 's@\(href="#_.*\)\(_param_\)\(.*"\)@\1_keyword_\3@g' \ # ++ pb global 341 # ONLINE_HELP, book="../idldoc_assistant_output/idldoc-lib.adp", /full_path # won't work 342 # encaspulate example content in <pre> </pre> in idldoc assistant outputs 343 # Examples section is supposed to start with <h3>Examples</h3> 344 # and end is before <h3>Version history</h3> 345 list_html=$(find ${output} -name "*.html") 346 for file_html in ${list_html} 347 do 348 sed \ 349 -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \ 350 -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/font>\)/\1\3/" \ 351 -e "/<h2>Produced on/d" \ 352 -e "/Last modification:/d" \ 353 -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \ 354 -e '/href/s@_param_@_keyword_@g' \ 355 -e 's@<div class="value">@<div class="preformat">@' \ 356 -e 's/div\#file_comments {/div\#file_comments { white-space: pre;/' \ 357 -e 's@^ <fixe>@<pre>@' \ 358 -e 's@^ </fixe>@</pre>@' \ 359 -e "s@<h3>Examples</h3>@<h3>Examples</h3><pre>@" \ 360 -e "s@<h3>Version history</h3>@</pre><h3>Version history</h3>@" \ 361 ${file_html} > ${file_html}_modify 362 mv ${file_html}_modify ${file_html} 363 done 364 # replace <pro>ginette</pro> by a sequence like 365 # <a href="./ginette.html">ginette</a> 366 ./pro2href.sh -i ${output} -r ${output} -e pro 367 status=${?} 368 if [ ${status} -ne 0 ] 369 then 370 echo "eee : pb during ./pro2href.sh for <pro>...</pro>" 371 exit 1 372 fi 373 # replace <proidl>ginette</proidl> by a sequence like 374 # <a href="./ginette.html">ginette</a> 375 ./pro2href.sh -i ${output} -r ${idl_dir}/help/online_help -e proidl 376 status=${?} 377 if [ ${status} -ne 0 ] 378 then 379 echo "eee : pb during ./pro2href.sh for <proidl>...</proidl>" 380 exit 1 381 fi 382 # add the directory-overview.html from dir-files.html in idldoc_html_output 383 list_html=$(find ../idldoc_html_output -name dir-files.html) 384 for file_html in ${list_html} 385 do 386 fout=../idldoc_assistant_output/${file_html#../idldoc_html_output/*} 387 fout=${fout%/*}/directory-overview.html 388 cp ${file_html} ${fout} 389 done 390 # copy listings.css (needed by directory-overview.html files) 391 cp ../idldoc/resource/listings.css ${output} 392 # add an id in idldoc-lib.adp 393 cat << EOF > /tmp/adp_modification 394 394 <!-- \$Id\$ --> 395 395 EOF 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 396 sed -e "/<\/profile>/r /tmp/adp_modification" \ 397 ../idldoc_assistant_output/idldoc-lib.adp > \ 398 ../idldoc_assistant_output/idldoc-lib.adp_${$} 399 mv ../idldoc_assistant_output/idldoc-lib.adp_${$} \ 400 ../idldoc_assistant_output/idldoc-lib.adp 401 rm /tmp/adp_modification 402 echo "iii : you can see log file in ${log}" 403 echo "iii : and look ${output}/idldoc-warnings.html#undoc" 404 # check that the number of existing html files for each .pro file is 2! 405 for i in $( find ../.. -name "*.pro" ) 406 do 407 nhtml=$( find ../.. -name $( basename ${i} .pro ).html | wc -l ) 408 if [ ${nhtml} -ne 2 ] 409 then 410 echo "ERROR there is no 2 $( basename ${i} .pro ).html files" 411 find ../.. -name $( basename ${i} .pro ).html 412 echo 413 fi 414 done 415 415 fi 416 416 #------------------------------------------------------------------ 417 417 if [ ${doTARsrc} -eq 1 ] 418 418 then 419 420 mkdir${localtarbase}/421 # clean backup files : *~422 423 # prepare the source tar (without the svn...)424 #425 426 427 #428 #informations429 430 419 localtarbase=/tmp/savesaxo_${$} 420 mkdir ${localtarbase}/ 421 # clean backup files : *~ 422 find ${memopwd}/../../.. -name "*~" -exec rm {} \; 423 # prepare the source tar (without the svn...) 424 # 425 cd ${memopwd}/../../.. 426 tar czf ${localtarbase}/SAXO_SRC_${ndate}r${rev}.tar.gz --exclude .svn SRC 427 # 428 # informations 429 echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" 430 ls -l ${localtarbase} 431 431 fi 432 432 #------------------------------------------------------------------ 433 433 if [ ${doTARdata} -eq 1 ] 434 434 then 435 436 mkdir${localtarbase}/437 #438 # prepare the data tar (without the svn...)439 #440 441 442 #443 #informations444 445 435 localtarbase=/tmp/savesaxo_${$} 436 mkdir ${localtarbase}/ 437 # 438 # prepare the data tar (without the svn...) 439 # 440 cd ${memopwd}/../../.. 441 tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz --exclude .svn DATA 442 # 443 # informations 444 echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/" 445 ls -l ${localtarbase} 446 446 fi 447 447 #------------------------------------------------------------------ 448 448 if [ ${doforge} -eq 1 ] 449 449 then 450 451 452 453 454 455 456 457 458 450 echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" 451 if [ ${doTARsrc} -ne 1 ] 452 then 453 localtarbase=${1} 454 fi 455 scp ${localtarbase}/SAXO_*.tar.gz ${lgforge}@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ 456 echo "iii : do not forget to update getsaxo.html" 457 echo "iii : \$ make ./getsaxo.html" 458 echo "iii : do not forget to clean ${localtarbase}" 459 459 fi 460 460 #------------------------------------------------------------------ 461 461 if [[ (${doDTAlocean} -eq 1) || (${doDTAipsl} -eq 1) ]] 462 462 then 463 464 465 466 467 463 echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" 464 infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) 465 filedata=$(echo ${infodata} | awk '{print $NF}') 466 filedata=$(basename ${filedata}) 467 cat <<EOF > job_data_$$ 468 468 #!/bin/bash 469 469 cd SAXO_DIR … … 483 483 if [ ${doSRClocean} -eq 1 ] 484 484 then 485 # update src on cerbere486 #487 488 485 # update src on cerbere 486 # 487 echo "iii : update src on cerbere" 488 ssh smasson@cerbere.locean-ipsl.upmc.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" 489 489 fi 490 490 #------------------------------------------------------------------ 491 491 if [ ${doDTAlocean} -eq 1 ] 492 492 then 493 # update data on cerbere494 495 496 493 # update data on cerbere 494 echo "iii : update data on cerbere" 495 scp job_data_$$ smasson@cerbere.locean-ipsl.upmc.fr:. 496 ssh smasson@cerbere.locean-ipsl.upmc.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" 497 497 fi 498 498 #------------------------------------------------------------------ 499 499 if [ ${doSRCipsl} -eq 1 ] 500 500 then 501 # update src on calcul2502 #503 504 501 # update src on calcul2 502 # 503 echo "iii : update src on calcul2" 504 ssh smlod@calcul2.ipsl.jussieu.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" 505 505 fi 506 506 #------------------------------------------------------------------ 507 507 if [ ${doDTAipsl} -eq 1 ] 508 508 then 509 # update data on cook510 511 512 509 # update data on cook 510 echo "iii : update data on cook" 511 scp job_data_$$ smlod@cook.ipsl.jussieu.fr:. 512 ssh smlod@cook.ipsl.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$" 513 513 fi 514 514 #------------------------------------------------------------------ 515 515 if [ ${doSRCidris} -eq 1 ] 516 516 then 517 # update src on ulam518 519 517 # update src on ulam 518 echo "iii : update src to ulam" 519 ssh -t smasson@cerbere.locean-ipsl.upmc.fr ssh reee217@ulam.idris.fr "svn update SAXO_DIR/SRC ; chmod -R 755 SAXO_DIR" 520 520 fi 521 521 #------------------------------------------------------------------ 522 522 if [ ${doDTAidris} -eq 1 ] 523 523 then 524 # create the update script for ulam525 526 527 528 529 530 531 532 524 # create the update script for ulam 525 if [[ (${doDTAlocean} -eq 0) && (${doDTAipsl} -eq 0) ]] 526 then 527 echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd" 528 infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) 529 filedata=$(echo ${infodata} | awk '{print $NF}') 530 filedata=$(basename ${filedata}) 531 fi 532 cat <<EOF > job_data_idris_$$ 533 533 #!/bin/ksh 534 534 cd SAXO_DIR … … 545 545 # 546 546 EOF 547 # update data on gaya548 549 550 547 # update data on gaya 548 echo "iii : update data to gaya" 549 scp job_data_idris_$$ reee217@gaya.idris.fr:. 550 ssh reee217@gaya.idris.fr "chmod 755 job_data_idris_$$ ; ./job_data_idris_$$ ; rm -f job_data_idris_$$" 551 551 fi 552 552 #------------------------------------------------------------------ 553 553 if [ ${dodocdownload} -eq 1 ] 554 554 then 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 sed\578 -e "/Source code of a file/s+../.*/../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC+g" \579 -e "/..\/..\/ToBeReviewed/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+g" \580 -e "/..\/..\/Tests/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+g" \581 -e "/..\/..\/Calendar/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+g" \582 -e "/..\/newheader/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/Documentation/+g" \583 ${file_html} > ${file_html}_${$}584 mv ${file_html}_${$} ${file_html}585 586 587 588 589 555 echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd several times" 556 # 557 # copy files in a temporary directory 558 mkdir /tmp/download_${$}/ 559 cp -rp ../xmldoc /tmp/download_${$}/ 560 cp -rp ../idldoc_html_output /tmp/download_${$}/ 561 # 562 # remove tools files 563 find /tmp/download_${$}/ -name ".svn" -exec rm -rf {} \; 2> /dev/null 564 find /tmp/download_${$}/ -name "*.xml" -exec rm -rf {} \; 2> /dev/null 565 find /tmp/download_${$}/ -name "*.xsl" -exec rm -rf {} \; 2> /dev/null 566 find /tmp/download_${$}/ -name "*.sed" -exec rm -rf {} \; 2> /dev/null 567 find /tmp/download_${$}/ -name "*.sh" -exec rm -rf {} \; 2> /dev/null 568 find /tmp/download_${$}/ -name "makefile" -exec rm -rf {} \; 2> /dev/null 569 find /tmp/download_${$}/ -name "*~" -exec rm -rf {} \; 2> /dev/null 570 # 571 # replace relative path 572 # by http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/ 573 # on ulink lines containing some directories like ../../ToBeReviewed/ or ../../Tests/ or file like newheader.txt 574 list_html=$(find /tmp/download_${$}/ -name "*.html") 575 for file_html in ${list_html} 576 do 577 sed \ 578 -e "/Source code of a file/s+../.*/../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC+g" \ 579 -e "/..\/..\/ToBeReviewed/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+g" \ 580 -e "/..\/..\/Tests/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+g" \ 581 -e "/..\/..\/Calendar/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/+g" \ 582 -e "/..\/newheader/s+../../+http://forge.ipsl.jussieu.fr/saxo/browser/trunk/SRC/Documentation/+g" \ 583 ${file_html} > ${file_html}_${$} 584 mv ${file_html}_${$} ${file_html} 585 done 586 echo 587 echo "give SAXO password if asked" 588 scp -rp /tmp/download_${$}/* saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/ 589 rm -rf /tmp/download_${$}/ 590 590 fi 591 591 # … … 593 593 if [ ${dowikiupdate} -eq 1 ] 594 594 then 595 596 597 rsync -av --exclude=".DS_Store"--exclude=".svn" ./wiki/ saxo@forge.ipsl.jussieu.fr:/tmp/saxo598 599 600 595 # uncomment this following line if you want to start from scratch 596 # ssh saxo@forge.ipsl.jussieu.fr mkdir -p /tmp/saxo 597 rsync -av --exclude=".DS_Store" --exclude=".svn" ./wiki/ saxo@forge.ipsl.jussieu.fr:/tmp/saxo 598 ssh saxo@forge.ipsl.jussieu.fr trac-admin /ipsl/forge/projets/saxo/trac wiki load /tmp/saxo 599 # uncomment this following line if you want to leave without any trace 600 # ssh saxo@forge.ipsl.jussieu.fr rm -rf /tmp/saxo 601 601 fi 602 602 #------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.