source: trunk/SRC/Documentation/xmldoc/savesaxo.sh @ 98

Last change on this file since 98 was 98, checked in by smasson, 18 years ago

bugfix ncdf_meshread + comments in compute_fromreg_bilinear_weigaddr

  • Property svn:executable set to *
File size: 7.9 KB
RevLine 
[86]1#!/bin/bash
[91]2# fplod 2006-06-07T12:11:50Z aedon.locean-ipsl.upmc.fr (Darwin)
3# add g option in ?format=raw sed transformation in order to fix
4# link on top of idldoc like directory-overview.html
[90]5# fplod 2006-06-07T10:57:35Z aedon.locean-ipsl.upmc.fr (Darwin)
6# add ?format=raw in idldoc production for frames
[89]7# fplod 2006-06-07T08:14:15Z aedon.locean-ipsl.upmc.fr (Darwin)
8# add action for idldochtml
[86]9# fplod 2006-06-02T14:28:30Z aedon.locean-ipsl.upmc.fr (Darwin)
10# modification to produce tar files in /tmp/saxo_${$} when dotar=1
11# modification to copy tar files on http://forge.ipsl.jussieu.fr/saxo/download/
12# when doforge=1
13# produce tar files in /tmp/saxo_${$} when dotar=1
14set -x
15set -u
16#
17dohtml=0
18dooldtest=0
[97]19doidldoc_html=1
[86]20doidldoc_assistant=0
21doidlwavedoc=0
[97]22doTARsrc=0
[88]23doTARdata=0
[97]24doforge=0
[88]25doSRClodyc=0
26doDTAlodyc=0
[98]27doSRCidris=1
28doDTAidris=1
[86]29#
[88]30#
31# get the date in a nice format
32#
33ndate=`date +%Y%m%d`
[86]34# memorize current directory
35memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc
[88]36#------------------------------------------------------------------
[86]37if [ ${dohtml} -eq 1 ]
38then
39#
40# redo the html file
41#
42    cd ${memopwd}
[88]43    for docxml in firststeps.xml getsaxo.xml mailing.xml main.xml tiplink.xml updatesaxo.xml whatissaxo.xml whatsnew.xml
[86]44    do
[88]45    ./makehtml.sh $(basename ${docxml} .xml)
[86]46 #   tidy -m $(basename ${docxml}).html
47    done
48    exit 0
49fi
[88]50#------------------------------------------------------------------
[86]51if [ ${dooldtest} -eq 1 ]
52then
53# make the old test
54#
55    cd ${memopwd}/../../Tests/
56    ./makeold.sh
57    exit 0
58fi
[88]59#------------------------------------------------------------------
[86]60if  [ ${doidlwavedoc} -eq 1 ]
61then
62#
63# redo idlwave doc
64#
65    cd ${memopwd}/../
66    Documentation/idlwave_catalog -v -f saxo
67    exit 0
68fi
[88]69#------------------------------------------------------------------
[86]70if  [ ${doidldoc_html} -eq 1 ]
71then
72#
[89]73    # build a idl file to launch idldoc
[97]74    cat <<EOF > /tmp/idldoc_html_${$}.pro
[89]75!path = expand_path('+' + '../idldoc/')
76print,!path
77idldoc,root="../../",LOG_FILE="/tmp/idldochtlm_${$}.log", $
[97]78output="../idldoc_html_output",/preformat
[89]79exit
80EOF
81    # launch idl with the file built above
[97]82    IDL_STARTUP=/tmp/idldoc_html_${$}.pro;idl
83    /bin/rm /tmp/idldoc_html_${$}.pro
[89]84    # In order to do not have to many revision in svn, we modify some
85    # lines produced by idldoc :
86    # examples :
87    # <!-- Generated by IDLdoc 2.0 on Wed Jun  7 10:25:28 2006 -->
88    # will be replaced by
89    # <!-- Generated by IDLdoc 2.0 -->
90    # <div id="tagline">Produced by IDLdoc 2.0 on Wed Jun  7 10:54:37 2006.</div
91    # will be replaced by
92    # <div id="tagline">Produced by IDLdoc 2.0</div>
93    # <h2>Produced on Wed Jun  7 10:23:13 2006</h2>
94    # will be delete
95    # other lines will be deleted because the time is the time of checkout not
96    # the time of revision.
97    # the sequence of lines
98    #<dl>
99    #      <dt>Last modification:</dt>
100    #       <dd>Fri Jun  2 11:46:24 2006</dd>
101    #    </dl>
102    # should also be removed ++ je ne sais pas dire en sed la ligne
103    # suivant l'occurence de Last modification
104    # add ?format=rawx to links on html files
105    list_html=$(find ../idldoc_html_output/ -name "*.html")
106    for file_html in ${list_html}
107    do
108     sed \
109     -e "s/\(Generated by IDLdoc 2.0\)\( on .*\)\( -->\)/\1\3/" \
110     -e "s/\(Produced by IDLdoc 2.0\)\( on .*\)\(\.<\/div>\)/\1\3/" \
111     -e "/<h2>Produced on/d" \
112     -e "/Last modification:/d" \
113     -e "/<dd>... ... .* ..:..:.. ....<\/dd>/d" \
[91]114     -e 's/\(href=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
115     -e 's/\(href=".*\)\(\.html\)\(#.*"\)/\1\2?format=raw\3/g' \
116     -e 's/\(src=".*\)\(\.html\)\("\)/\1\2?format=raw\3/g' \
[89]117     ${file_html} > ${file_html}_modify
118     mv ${file_html}_modify ${file_html}
119    done
120    echo "iii : you can see log file in /tmp/idldochtlm_${$}.log"
121    echo "iii : and look ../idldoc_html_output/idldoc-warnings.html#undoc"
[86]122    exit 1
123fi
[88]124#------------------------------------------------------------------
[86]125if  [ ${doidldoc_assistant} -eq 1 ]
126then
127#
128    echo "eee : pas encore ecrit"
129    exit 1
130fi
[88]131#------------------------------------------------------------------
132if [ ${doTARsrc} -eq 1 ]
[86]133then
134    localtarbase=/tmp/savesaxo_${$}
135    mkdir  ${localtarbase}/
[87]136# clean backup files : *~
[88]137    find ${memopwd}/../../.. -name "*~" -exec rm {} \;
[87]138# prepare the source tar (without the svn...)
[86]139#
[87]140    cd ${memopwd}/../../..
141    tar czf ${localtarbase}/SAXO_SRC_${ndate}.tar.gz --exclude .svn SRC
[86]142#
[87]143#   informations
[89]144    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
[87]145    ls -l ${localtarbase}
146fi
[88]147#------------------------------------------------------------------
148if [ ${doTARdata} -eq 1 ]
[87]149then
150    localtarbase=/tmp/savesaxo_${$}
151    mkdir  ${localtarbase}/
[86]152#
[87]153# prepare the data tar (without the svn...)
154#
155    cd ${memopwd}/../../..
156    tar czf ${localtarbase}/SAXO_DATA_${ndate}.tar.gz  --exclude .svn DATA
157#
[86]158#   informations
[89]159    echo "iii : following file may be copied on http://forge.ipsl.jussieu.fr/saxo/download/"
[86]160    ls -l ${localtarbase}
161fi
[88]162#------------------------------------------------------------------
[86]163if [ ${doforge} -eq 1 ]
164then
165    echo "iii : you will be asked saxo@forge.ipsl.jussieu.fr passwd two times"
[88]166    if [ ${doTARsrc} -ne 1 ]
[86]167    then
[89]168       localtarbase=${1}
[86]169    fi
[88]170    scp ${localtarbase}/SAXO_*.tar.gz saxo@forge.ipsl.jussieu.fr:/ipsl/forge/projets/saxo/download/
[86]171    echo "iii : do not forget to update getsaxo.html"
172    echo "iii : \$ ./makehtml.sh getsaxo"
173    echo "iii : do not forget to clean ${localtarbase}"
174fi
[88]175#------------------------------------------------------------------
176if [[ ($doSRClodyc -eq 1) || ($doDTAidris -eq 1) ]]
[86]177then
[88]178infosrc=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz  | head -n 1)
179filesrc=$(echo ${infosrc} | awk '{print $NF}')
180filesrc=$( basename $filesrc )
[98]181[ $doSRClodyc -eq 1 ] && rshell=bash || rshell=ksh
[86]182#
[88]183    cat <<EOF > job_src_$$
[98]184#!/bin/${rshell}
[88]185cd SAXO_DIR
[86]186#
[88]187rm -rf SRC
188wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc
189gunzip $filesrc
[98]190tar vxf $( basename $filesrc .gz )
[88]191rm -f $( basename $filesrc .gz )
[86]192#
[88]193chmod -R 755 *
194exit
195#
196EOF
[86]197fi
198#
[88]199if [[ ($doDTAlodyc -eq 1) || ($doDTAidris -eq 1) ]]
200then
201infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1)
202filedata=$(echo ${infodata} | awk '{print $NF}')
203filedata=$(basename $filedata)
[98]204[ $doDTAlodyc -eq 1 ] && rshell=bash || rshell=ksh
[88]205    cat <<EOF > job_data_$$
[98]206#!/bin/${rshell}
[88]207cd SAXO_DIR
[86]208#
[88]209rm -rf DATA
210wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata
211gunzip $filedata
[98]212tar vxf $( basename $filedata .gz )
[88]213rm -f $( basename $filedata .gz )
214#
215chmod -R 755 *
216exit
217#
[86]218EOF
[88]219fi
220#------------------------------------------------------------------
221if [ $doSRClodyc -eq 1 ]
222then
223# update src on cerbere
[86]224#
[88]225    echo "iii : update src on cerbere  cerbere"
226    scp job_src_$$ smasson@cerbere.lodyc.jussieu.fr:.
227    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
228fi
229#------------------------------------------------------------------
230if [ $doDTAlodyc -eq 1 ]
231then
232# update data on cerbere
233    echo "iii : update data on cerbere"
234    scp job_data_$$ smasson@cerbere.lodyc.jussieu.fr:.
235    ssh smasson@cerbere.lodyc.jussieu.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
236fi
237#------------------------------------------------------------------
238if [ $doSRCidris -eq 1 ]
239then
240# update src on rhodes
241    echo "iii : update src to rhodes"
242    scp job_src_$$ reee217@rhodes.idris.fr:.
243    ssh reee217@rhodes.idris.fr "chmod 755 job_src_$$ ; ./job_src_$$ ; rm -f job_src_$$"
244fi
245#------------------------------------------------------------------
246if [ $doDTAidris -eq 1 ]
247then
248# update data on gaya
249    echo "iii : update data to gaya"
250    scp job_data_$$ reee217@gaya.idris.fr:.
251    ssh reee217@gaya.idris.fr "chmod 755 job_data_$$ ; ./job_data_$$ ; rm -f job_data_$$"
252fi
253#------------------------------------------------------------------
[86]254#
[88]255[ -f job_src_$$ ] && rm -f job_src_$$
[89]256[ -f job_data_$$ ] && rm -f
[86]257#
[88]258exit
[86]259#
Note: See TracBrowser for help on using the repository browser.