Ignore:
Timestamp:
04/15/10 15:13:55 (14 years ago)
Author:
pinsard
Message:

indent shell scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Documentation/xmldoc/savesaxo.sh

    r425 r430  
    161161# 
    162162case $( whoami ) in 
    163     smasson) 
    164         lgforge=smasson 
    165     ;; 
    166     floseb) 
    167         lgforge=smasson 
    168     ;; 
    169     *) 
    170         lgforge=saxo 
    171     ;; 
     163   smasson) 
     164      lgforge=smasson 
     165   ;; 
     166   floseb) 
     167      lgforge=smasson 
     168   ;; 
     169   *) 
     170      lgforge=saxo 
     171   ;; 
    172172esac 
    173173# 
    174174if [ ${lgforge} != smasson ] 
    175175then 
    176     doSRClocean=0 
    177     doDTAlocean=0 
    178     doSRCipsl=0 
    179     doDTAipsl=0 
    180     doSRCidris=0 
    181     doDTAidris=0 
     176   doSRClocean=0 
     177   doDTAlocean=0 
     178   doSRCipsl=0 
     179   doDTAipsl=0 
     180   doSRCidris=0 
     181   doDTAidris=0 
    182182fi 
    183183# 
     
    191191#------------------------------------------------------------------ 
    192192if [ ${docompileall} -eq 1 ] 
    193     then 
    194     cat <<EOF > /tmp/compileall${$}.pro 
     193then 
     194   cat <<EOF > /tmp/compileall${$}.pro 
    195195.reset_session 
    196196; 
     
    214214EOF 
    215215# 
    216     for i in $( find ${memopwd}/../.. -name "*.pro" | grep -iv label_gmt  | grep -iv report ) 
    217       do 
    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 ? 
    219219      egrep -iq '^ *    *(pro|function)' ${i} 
    220220      if [ ${?} -eq 0 ] 
    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 
     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 
    224224      fi 
    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 
     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 
    245245fi 
    246246#------------------------------------------------------------------ 
    247247if [ ${dohtml} -eq 1 ] 
    248248then 
    249 # 
    250 # redo the HTML files 
    251 # 
    252     cd ${memopwd} 
    253     make clean 
    254     make html  
     249   # 
     250   # redo the HTML files 
     251   # 
     252   cd ${memopwd} 
     253   make clean 
     254   make html  
    255255fi 
    256256#------------------------------------------------------------------ 
    257257if [ ${dowiki} -eq 1 ] 
    258258then 
    259 # 
    260 # redo the WIKI files 
    261 # 
    262     cd ${memopwd} 
    263     make clean  
    264     make tracwiki 
     259   # 
     260   # redo the WIKI files 
     261   # 
     262   cd ${memopwd} 
     263   make clean  
     264   make tracwiki 
    265265fi 
    266266#------------------------------------------------------------------ 
    267267if [ ${dooldtest} -eq 1 ] 
    268268then 
    269 # make the old test 
    270 # 
    271     cd ${memopwd}/../../Tests/ 
    272     ./makeold.sh 
    273     exit 0 
     269   # make the old test 
     270   # 
     271   cd ${memopwd}/../../Tests/ 
     272   ./makeold.sh 
     273   exit 0 
    274274fi 
    275275#------------------------------------------------------------------ 
    276276if  [ ${doidlwavedoc} -eq 1 ] 
    277277then 
    278 # 
    279 # redo idlwave doc 
    280 # 
    281     cd ${memopwd}/../.. 
    282     Documentation/idlwave_catalog -v -f saxo 
    283     exit 0 
     278   # 
     279   # redo idlwave doc 
     280   # 
     281   cd ${memopwd}/../.. 
     282   Documentation/idlwave_catalog -v -f saxo 
     283   exit 0 
    284284fi 
    285285#------------------------------------------------------------------ 
    286286if  [ ${doidldoc} -eq 1 ] 
    287287then 
    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} 
     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} 
    308308!path = expand_path('+' + '../idldoc/') 
    309309print,!path 
     
    313313exit 
    314314EOF 
    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">&nbsp;&nbsp;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">&nbsp;&nbsp;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 
     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">&nbsp;&nbsp;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">&nbsp;&nbsp;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 
    394394<!-- \$Id\$ --> 
    395395EOF 
    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 
     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 
    415415fi 
    416416#------------------------------------------------------------------ 
    417417if [ ${doTARsrc} -eq 1 ] 
    418418then 
    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} 
     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} 
    431431fi 
    432432#------------------------------------------------------------------ 
    433433if [ ${doTARdata} -eq 1 ] 
    434434then 
    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} 
     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} 
    446446fi 
    447447#------------------------------------------------------------------ 
    448448if [ ${doforge} -eq 1 ] 
    449449then 
    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}" 
     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}" 
    459459fi 
    460460#------------------------------------------------------------------ 
    461461if [[ (${doDTAlocean} -eq 1) || (${doDTAipsl} -eq 1) ]] 
    462462then 
    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_$$ 
     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_$$ 
    468468#!/bin/bash 
    469469cd SAXO_DIR 
     
    483483if [ ${doSRClocean} -eq 1 ] 
    484484then 
    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" 
     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" 
    489489fi 
    490490#------------------------------------------------------------------ 
    491491if [ ${doDTAlocean} -eq 1 ] 
    492492then 
    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_$$" 
     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_$$" 
    497497fi 
    498498#------------------------------------------------------------------ 
    499499if [ ${doSRCipsl} -eq 1 ] 
    500500then 
    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" 
     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" 
    505505fi 
    506506#------------------------------------------------------------------ 
    507507if [ ${doDTAipsl} -eq 1 ] 
    508508then 
    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_$$" 
     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_$$" 
    513513fi 
    514514#------------------------------------------------------------------ 
    515515if [ ${doSRCidris} -eq 1 ] 
    516516then 
    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" 
     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" 
    520520fi 
    521521#------------------------------------------------------------------ 
    522522if [ ${doDTAidris} -eq 1 ] 
    523523then 
    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_$$ 
     524   # create the update script for ulam 
     525   if [[ (${doDTAlocean} -eq 0) && (${doDTAipsl} -eq 0) ]] 
     526then 
     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_$$ 
    533533#!/bin/ksh 
    534534cd SAXO_DIR 
     
    545545# 
    546546EOF 
    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_$$" 
     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_$$" 
    551551fi 
    552552#------------------------------------------------------------------ 
    553553if [ ${dodocdownload} -eq 1 ] 
    554554then 
    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_${$}/ 
     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_${$}/ 
    590590fi 
    591591# 
     
    593593if [ ${dowikiupdate} -eq 1 ] 
    594594then 
    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 
     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 
    601601fi 
    602602#------------------------------------------------------------------ 
Note: See TracChangeset for help on using the changeset viewer.