[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 |
---|
| 14 | set -x |
---|
| 15 | set -u |
---|
| 16 | # |
---|
| 17 | dohtml=0 |
---|
| 18 | dooldtest=0 |
---|
[97] | 19 | doidldoc_html=1 |
---|
[86] | 20 | doidldoc_assistant=0 |
---|
| 21 | doidlwavedoc=0 |
---|
[97] | 22 | doTARsrc=0 |
---|
[88] | 23 | doTARdata=0 |
---|
[97] | 24 | doforge=0 |
---|
[88] | 25 | doSRClodyc=0 |
---|
| 26 | doDTAlodyc=0 |
---|
[98] | 27 | doSRCidris=1 |
---|
| 28 | doDTAidris=1 |
---|
[86] | 29 | # |
---|
[88] | 30 | # |
---|
| 31 | # get the date in a nice format |
---|
| 32 | # |
---|
| 33 | ndate=`date +%Y%m%d` |
---|
[86] | 34 | # memorize current directory |
---|
| 35 | memopwd=$(pwd) # should be <working space>/SRC/Documentation/xmldoc |
---|
[88] | 36 | #------------------------------------------------------------------ |
---|
[86] | 37 | if [ ${dohtml} -eq 1 ] |
---|
| 38 | then |
---|
| 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 |
---|
| 49 | fi |
---|
[88] | 50 | #------------------------------------------------------------------ |
---|
[86] | 51 | if [ ${dooldtest} -eq 1 ] |
---|
| 52 | then |
---|
| 53 | # make the old test |
---|
| 54 | # |
---|
| 55 | cd ${memopwd}/../../Tests/ |
---|
| 56 | ./makeold.sh |
---|
| 57 | exit 0 |
---|
| 58 | fi |
---|
[88] | 59 | #------------------------------------------------------------------ |
---|
[86] | 60 | if [ ${doidlwavedoc} -eq 1 ] |
---|
| 61 | then |
---|
| 62 | # |
---|
| 63 | # redo idlwave doc |
---|
| 64 | # |
---|
| 65 | cd ${memopwd}/../ |
---|
| 66 | Documentation/idlwave_catalog -v -f saxo |
---|
| 67 | exit 0 |
---|
| 68 | fi |
---|
[88] | 69 | #------------------------------------------------------------------ |
---|
[86] | 70 | if [ ${doidldoc_html} -eq 1 ] |
---|
| 71 | then |
---|
| 72 | # |
---|
[89] | 73 | # build a idl file to launch idldoc |
---|
[97] | 74 | cat <<EOF > /tmp/idldoc_html_${$}.pro |
---|
[89] | 75 | !path = expand_path('+' + '../idldoc/') |
---|
| 76 | print,!path |
---|
| 77 | idldoc,root="../../",LOG_FILE="/tmp/idldochtlm_${$}.log", $ |
---|
[97] | 78 | output="../idldoc_html_output",/preformat |
---|
[89] | 79 | exit |
---|
| 80 | EOF |
---|
| 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 |
---|
| 123 | fi |
---|
[88] | 124 | #------------------------------------------------------------------ |
---|
[86] | 125 | if [ ${doidldoc_assistant} -eq 1 ] |
---|
| 126 | then |
---|
| 127 | # |
---|
| 128 | echo "eee : pas encore ecrit" |
---|
| 129 | exit 1 |
---|
| 130 | fi |
---|
[88] | 131 | #------------------------------------------------------------------ |
---|
| 132 | if [ ${doTARsrc} -eq 1 ] |
---|
[86] | 133 | then |
---|
| 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} |
---|
| 146 | fi |
---|
[88] | 147 | #------------------------------------------------------------------ |
---|
| 148 | if [ ${doTARdata} -eq 1 ] |
---|
[87] | 149 | then |
---|
| 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} |
---|
| 161 | fi |
---|
[88] | 162 | #------------------------------------------------------------------ |
---|
[86] | 163 | if [ ${doforge} -eq 1 ] |
---|
| 164 | then |
---|
| 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}" |
---|
| 174 | fi |
---|
[88] | 175 | #------------------------------------------------------------------ |
---|
| 176 | if [[ ($doSRClodyc -eq 1) || ($doDTAidris -eq 1) ]] |
---|
[86] | 177 | then |
---|
[88] | 178 | infosrc=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
| 179 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
| 180 | filesrc=$( basename $filesrc ) |
---|
[98] | 181 | [ $doSRClodyc -eq 1 ] && rshell=bash || rshell=ksh |
---|
[86] | 182 | # |
---|
[88] | 183 | cat <<EOF > job_src_$$ |
---|
[98] | 184 | #!/bin/${rshell} |
---|
[88] | 185 | cd SAXO_DIR |
---|
[86] | 186 | # |
---|
[88] | 187 | rm -rf SRC |
---|
| 188 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filesrc |
---|
| 189 | gunzip $filesrc |
---|
[98] | 190 | tar vxf $( basename $filesrc .gz ) |
---|
[88] | 191 | rm -f $( basename $filesrc .gz ) |
---|
[86] | 192 | # |
---|
[88] | 193 | chmod -R 755 * |
---|
| 194 | exit |
---|
| 195 | # |
---|
| 196 | EOF |
---|
[86] | 197 | fi |
---|
| 198 | # |
---|
[88] | 199 | if [[ ($doDTAlodyc -eq 1) || ($doDTAidris -eq 1) ]] |
---|
| 200 | then |
---|
| 201 | infodata=$(ssh saxo@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
| 202 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
| 203 | filedata=$(basename $filedata) |
---|
[98] | 204 | [ $doDTAlodyc -eq 1 ] && rshell=bash || rshell=ksh |
---|
[88] | 205 | cat <<EOF > job_data_$$ |
---|
[98] | 206 | #!/bin/${rshell} |
---|
[88] | 207 | cd SAXO_DIR |
---|
[86] | 208 | # |
---|
[88] | 209 | rm -rf DATA |
---|
| 210 | wget http://forge.ipsl.jussieu.fr/saxo/download/$filedata |
---|
| 211 | gunzip $filedata |
---|
[98] | 212 | tar vxf $( basename $filedata .gz ) |
---|
[88] | 213 | rm -f $( basename $filedata .gz ) |
---|
| 214 | # |
---|
| 215 | chmod -R 755 * |
---|
| 216 | exit |
---|
| 217 | # |
---|
[86] | 218 | EOF |
---|
[88] | 219 | fi |
---|
| 220 | #------------------------------------------------------------------ |
---|
| 221 | if [ $doSRClodyc -eq 1 ] |
---|
| 222 | then |
---|
| 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_$$" |
---|
| 228 | fi |
---|
| 229 | #------------------------------------------------------------------ |
---|
| 230 | if [ $doDTAlodyc -eq 1 ] |
---|
| 231 | then |
---|
| 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_$$" |
---|
| 236 | fi |
---|
| 237 | #------------------------------------------------------------------ |
---|
| 238 | if [ $doSRCidris -eq 1 ] |
---|
| 239 | then |
---|
| 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_$$" |
---|
| 244 | fi |
---|
| 245 | #------------------------------------------------------------------ |
---|
| 246 | if [ $doDTAidris -eq 1 ] |
---|
| 247 | then |
---|
| 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_$$" |
---|
| 252 | fi |
---|
| 253 | #------------------------------------------------------------------ |
---|
[86] | 254 | # |
---|
[88] | 255 | [ -f job_src_$$ ] && rm -f job_src_$$ |
---|
[89] | 256 | [ -f job_data_$$ ] && rm -f |
---|
[86] | 257 | # |
---|
[88] | 258 | exit |
---|
[86] | 259 | # |
---|