[65] | 1 | #!/bin/bash |
---|
[85] | 2 | # |
---|
[123] | 3 | # update : |
---|
| 4 | # $Id$ |
---|
| 5 | # fplod 2006-07-05T13:18:56Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 6 | # add infoupdatecm |
---|
| 7 | # add sort and varname in production of infoupdatekwd |
---|
[92] | 8 | # fplod 2006-06-07T13:55:07Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 9 | # add infoupdatekwd |
---|
[86] | 10 | # fplod 2006-06-02T14:37:47Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 11 | # take only one tar file : the most recent using modification time |
---|
[85] | 12 | # fplod 2006-06-02T10:00:41Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 13 | # http://forge.ipsl.jussieu.fr/saxo/download/ is the new directory reference |
---|
[87] | 14 | # for tar file instead of ~/SAXO_SRC/ ie home of Sebatien Masson on |
---|
[85] | 15 | # arete.lodyc.jussieu.fr |
---|
| 16 | # !!! saxo@forge.ipsl.jussieu.fr password is needed |
---|
[79] | 17 | # fplod 2006-05-31T10:34:18Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 18 | # . add creation of all_plots.html using firststeps.html |
---|
[87] | 19 | # . remplace ~/SAXO_SRC/SRC/Documentation/xmldoc/figpng by ./figpng/ |
---|
[79] | 20 | # we suppose that this shell script is launched when we are in |
---|
| 21 | # <working space of saxo>/SRC/Documentation/xmldoc/ |
---|
| 22 | # |
---|
[65] | 23 | set -u |
---|
[79] | 24 | # |
---|
[100] | 25 | case $( whoami ) in |
---|
| 26 | smasson) |
---|
| 27 | lgforge=smasson |
---|
| 28 | ;; |
---|
| 29 | floseb) |
---|
| 30 | lgforge=smasson |
---|
| 31 | ;; |
---|
| 32 | *) |
---|
| 33 | lgforge=saxo |
---|
| 34 | ;; |
---|
| 35 | esac |
---|
| 36 | # |
---|
[79] | 37 | case "${1}" in |
---|
[84] | 38 | getsaxo) |
---|
[87] | 39 | # size of SRCand DATA with .svn |
---|
| 40 | szallsvn=$( du -sh ../../.. | awk '{print $1}' ) |
---|
| 41 | szallsvn=${szallsvn%*M} |
---|
| 42 | # size of SRC with .svn |
---|
| 43 | szsrcsvn=$( du -sh ../../../SRC | awk '{print $1}' ) |
---|
| 44 | szsrcsvn=${szsrcsvn%*M} |
---|
| 45 | # size of DATA with .svn |
---|
| 46 | szdatasvn=$( du -sh ../../../DATA | awk '{print $1}' ) |
---|
| 47 | szdatasvn=${szdatasvn%*M} |
---|
[100] | 48 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" |
---|
[87] | 49 | # find the most recent SAXO_SRC_yyyymmdd.tar.gz in |
---|
[85] | 50 | # /ipsl/forge/projets/saxo/download/ |
---|
[100] | 51 | infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
[85] | 52 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
| 53 | szsrc=$(echo ${infosrc} | awk '{print $5}') |
---|
[87] | 54 | # ndate is the date in the file SAXO_SRC_*.tar.gz |
---|
[85] | 55 | ndate=${filesrc##*_} |
---|
[79] | 56 | ndate=${ndate%.tar.gz} |
---|
[87] | 57 | # find the most recent SAXO_DATA_yyyymmdd.tar.gz in |
---|
[85] | 58 | # /ipsl/forge/projets/saxo/download/ |
---|
[100] | 59 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
[85] | 60 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
| 61 | szdata=$(echo ${infodata} | awk '{print $5}') |
---|
[87] | 62 | # ndate2 is the date in the file SAXO_DATA_*.tar.gz |
---|
[85] | 63 | ndate2=${filedata##*_} |
---|
[79] | 64 | ndate2=${ndate2%.tar.gz} |
---|
| 65 | ;; |
---|
[92] | 66 | infoupdatekwd) |
---|
| 67 | grep "^ old = \[old, .* new = \[new" ../../ForOldVersion/updatekwd.pro | \ |
---|
[123] | 68 | sort | \ |
---|
| 69 | sed -e "s/\( old = \[old, '\)\(.*\)\('\] *& new = \[new, '\)\(.*\)\('\]\)/<row><entry colname='old'><varname>\2<\/varname><\/entry> <entry colname='new'><varname>\4<\/varname><\/entry><\/row>/" > /tmp/rowskwd.xml |
---|
[92] | 70 | ;; |
---|
[123] | 71 | infoupdatecm) |
---|
| 72 | grep "IF NOT key_forgetold AND n_elements(" ../../ForOldVersion/updateold.pro | \ |
---|
| 73 | sort | \ |
---|
| 74 | sed -e "s/\(^.* THEN \)\(.*\)\( = \)\(.*\)/<row><entry colname='old'><varname>\2<\/varname><\/entry> <entry colname='new'><varname>\4<\/varname><\/entry><\/row>/" > /tmp/rowscm.xml |
---|
| 75 | ;; |
---|
[79] | 76 | *) |
---|
| 77 | echo "iii : no ndate determination needed" |
---|
| 78 | ;; |
---|
| 79 | esac |
---|
| 80 | |
---|
[65] | 81 | # figures lists |
---|
[79] | 82 | cd ./figpng |
---|
[65] | 83 | |
---|
| 84 | # |
---|
| 85 | figsplt_lev="" |
---|
| 86 | for i in tst_plt_lev_[0-9][0-9].png |
---|
| 87 | do |
---|
[81] | 88 | figsplt_lev="${figsplt_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 89 | done |
---|
| 90 | figspltz_lev="" |
---|
| 91 | for i in tst_pltz_lev_[0-9][0-9].png |
---|
| 92 | do |
---|
[81] | 93 | figspltz_lev="${figspltz_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 94 | done |
---|
| 95 | figspltt_lev="" |
---|
| 96 | for i in tst_pltt_lev_[0-9][0-9].png |
---|
| 97 | do |
---|
[81] | 98 | figspltt_lev="${figspltt_lev} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 99 | done |
---|
| 100 | # |
---|
| 101 | figsplt_orca2="" |
---|
| 102 | for i in tst_plt_orca2_[0-9][0-9].png |
---|
| 103 | do |
---|
[81] | 104 | figsplt_orca2="${figsplt_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 105 | done |
---|
| 106 | figspltz_orca2="" |
---|
| 107 | for i in tst_pltz_orca2_[0-9][0-9].png |
---|
| 108 | do |
---|
[81] | 109 | figspltz_orca2="${figspltz_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 110 | done |
---|
| 111 | figspltt_orca2="" |
---|
| 112 | for i in tst_pltt_orca2_[0-9][0-9].png |
---|
| 113 | do |
---|
[81] | 114 | figspltt_orca2="${figspltt_orca2} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 115 | done |
---|
| 116 | # |
---|
| 117 | figsplt_orca05="" |
---|
| 118 | for i in tst_plt_orca05_[0-9][0-9].png |
---|
| 119 | do |
---|
[81] | 120 | figsplt_orca05="${figsplt_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 121 | done |
---|
| 122 | figspltz_orca05="" |
---|
| 123 | for i in tst_pltz_orca05_[0-9][0-9].png |
---|
| 124 | do |
---|
[81] | 125 | figspltz_orca05="${figspltz_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 126 | done |
---|
| 127 | figspltt_orca05="" |
---|
| 128 | for i in tst_pltt_orca05_[0-9][0-9].png |
---|
| 129 | do |
---|
[81] | 130 | figspltt_orca05="${figspltt_orca05} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 131 | done |
---|
| 132 | ## |
---|
| 133 | # |
---|
| 134 | figsplt_lev_stride="" |
---|
| 135 | for i in tst_plt_lev_stride_[0-9][0-9].png |
---|
| 136 | do |
---|
[81] | 137 | figsplt_lev_stride="${figsplt_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 138 | done |
---|
| 139 | figspltz_lev_stride="" |
---|
| 140 | for i in tst_pltz_lev_stride_[0-9][0-9].png |
---|
| 141 | do |
---|
[81] | 142 | figspltz_lev_stride="${figspltz_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 143 | done |
---|
| 144 | figspltt_lev_stride="" |
---|
| 145 | for i in tst_pltt_lev_stride_[0-9][0-9].png |
---|
| 146 | do |
---|
[81] | 147 | figspltt_lev_stride="${figspltt_lev_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 148 | done |
---|
| 149 | # |
---|
| 150 | figsplt_orca2_stride="" |
---|
| 151 | for i in tst_plt_orca2_stride_[0-9][0-9].png |
---|
| 152 | do |
---|
[81] | 153 | figsplt_orca2_stride="${figsplt_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 154 | done |
---|
| 155 | figspltz_orca2_stride="" |
---|
| 156 | for i in tst_pltz_orca2_stride_[0-9][0-9].png |
---|
| 157 | do |
---|
[81] | 158 | figspltz_orca2_stride="${figspltz_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 159 | done |
---|
| 160 | figspltt_orca2_stride="" |
---|
| 161 | for i in tst_pltt_orca2_stride_[0-9][0-9].png |
---|
| 162 | do |
---|
[81] | 163 | figspltt_orca2_stride="${figspltt_orca2_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 164 | done |
---|
| 165 | # |
---|
| 166 | figsplt_orca05_stride="" |
---|
| 167 | for i in tst_plt_orca05_stride_[0-9][0-9].png |
---|
| 168 | do |
---|
[81] | 169 | figsplt_orca05_stride="${figsplt_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 170 | done |
---|
| 171 | figspltz_orca05_stride="" |
---|
| 172 | for i in tst_pltz_orca05_stride_[0-9][0-9].png |
---|
| 173 | do |
---|
[81] | 174 | figspltz_orca05_stride="${figspltz_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 175 | done |
---|
| 176 | figspltt_orca05_stride="" |
---|
| 177 | for i in tst_pltt_orca05_stride_[0-9][0-9].png |
---|
| 178 | do |
---|
[81] | 179 | figspltt_orca05_stride="${figspltt_orca05_stride} \<ulink url=\"figpng\/${i}?format=raw\"\>\&showfig\;\<\/ulink\>" |
---|
[65] | 180 | done |
---|
| 181 | ## |
---|
[79] | 182 | cd .. # ie <working space of saxo>/SRC/Documentation/xmldoc |
---|
| 183 | |
---|
| 184 | case "${1}" in |
---|
[85] | 185 | getsaxo) |
---|
| 186 | sed -e s/"\&date\;"/${ndate}/g \ |
---|
| 187 | -e s/"\&date2\;"/${ndate2}/g \ |
---|
| 188 | -e s/"\&szsrc\;"/${szsrc}/g \ |
---|
| 189 | -e s/"\&szdata\;"/${szdata}/g \ |
---|
[87] | 190 | -e s/"\&szallsvn\;"/${szallsvn}/g \ |
---|
| 191 | -e s/"\&szsrcsvn\;"/${szsrcsvn}/g \ |
---|
| 192 | -e s/"\&szdatasvn\;"/${szdatasvn}/g \ |
---|
[85] | 193 | ${1}.xml > ${1}_${$}.xml |
---|
| 194 | ;; |
---|
[88] | 195 | firststeps) |
---|
[84] | 196 | sed -e s/"\&figsplt_lev\;"/"${figsplt_lev}"/g \ |
---|
[79] | 197 | -e s/"\&figsplt_orca2\;"/"${figsplt_orca2}"/g \ |
---|
| 198 | -e s/"\&figsplt_orca05\;"/"${figsplt_orca05}"/g \ |
---|
| 199 | -e s/"\&figspltz_lev\;"/"${figspltz_lev}"/g \ |
---|
| 200 | -e s/"\&figspltz_orca2\;"/"${figspltz_orca2}"/g \ |
---|
| 201 | -e s/"\&figspltz_orca05\;"/"${figspltz_orca05}"/g \ |
---|
| 202 | -e s/"\&figspltt_lev\;"/"${figspltt_lev}"/g \ |
---|
| 203 | -e s/"\&figspltt_orca2\;"/"${figspltt_orca2}"/g \ |
---|
| 204 | -e s/"\&figspltt_orca05\;"/"${figspltt_orca05}"/g \ |
---|
| 205 | -e s/"\&figsplt_lev_stride\;"/"${figsplt_lev_stride}"/g \ |
---|
| 206 | -e s/"\&figsplt_orca2_stride\;"/"${figsplt_orca2_stride}"/g \ |
---|
| 207 | -e s/"\&figsplt_orca05_stride\;"/"${figsplt_orca05_stride}"/g \ |
---|
| 208 | -e s/"\&figspltz_lev_stride\;"/"${figspltz_lev_stride}"/g \ |
---|
| 209 | -e s/"\&figspltz_orca2_stride\;"/"${figspltz_orca2_stride}"/g \ |
---|
| 210 | -e s/"\&figspltz_orca05_stride\;"/"${figspltz_orca05_stride}"/g \ |
---|
| 211 | -e s/"\&figspltt_lev_stride\;"/"${figspltt_lev_stride}"/g \ |
---|
| 212 | -e s/"\&figspltt_orca2_stride\;"/"${figspltt_orca2_stride}"/g \ |
---|
| 213 | -e s/"\&figspltt_orca05_stride\;"/"${figspltt_orca05_stride}"/g \ |
---|
| 214 | ${1}.xml > ${1}_${$}.xml |
---|
| 215 | ;; |
---|
[92] | 216 | infoupdatekwd) |
---|
[123] | 217 | sed -e "/-- rows from updatekwd.pro --/r /tmp/rowskwd.xml" \ |
---|
[92] | 218 | ${1}.xml > ${1}_${$}.xml |
---|
[123] | 219 | /bin/rm /tmp/rowskwd.xml |
---|
[92] | 220 | ;; |
---|
[123] | 221 | infoupdatecm) |
---|
| 222 | sed -e "/-- rows from updateold.pro --/r /tmp/rowscm.xml" \ |
---|
| 223 | ${1}.xml > ${1}_${$}.xml |
---|
| 224 | /bin/rm /tmp/rowscm.xml |
---|
| 225 | ;; |
---|
[79] | 226 | *) |
---|
| 227 | cp ${1}.xml ${1}_${$}.xml |
---|
| 228 | echo "iii : no xml transformation needed" |
---|
| 229 | ;; |
---|
| 230 | esac |
---|
[65] | 231 | # |
---|
| 232 | CLASSPATH="$CLASSPATH:\ |
---|
| 233 | /sw/share/java/saxon/saxon.jar:\ |
---|
| 234 | /sw/share/xml/xsl/docbook-xsl/extensions/saxon653.jar" |
---|
| 235 | export CLASSPATH |
---|
| 236 | #java com.icl.saxon.StyleSheet \ |
---|
| 237 | # -o ${1}.html ${1}.xml \ |
---|
| 238 | # /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl \ |
---|
[79] | 239 | # use.extensions=1 section.autolabel=1 html.stylesheet="saxo.css" css.decoration=1 |
---|
[65] | 240 | # |
---|
| 241 | # callout.graphics.path="/sw/share/xml/xsl/docbook-xsl/images/callouts/" |
---|
| 242 | |
---|
[79] | 243 | java com.icl.saxon.StyleSheet -o ${1}.html ${1}_${$}.xml \ |
---|
[65] | 244 | /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl \ |
---|
[79] | 245 | section.autolabel=1 html.stylesheet="saxo.css" css.decoration=1 |
---|
| 246 | |
---|
| 247 | case "${1}" in |
---|
| 248 | firststeps) |
---|
| 249 | java com.icl.saxon.StyleSheet -o all_plots_${$}.xml ${1}_${$}.xml \ |
---|
| 250 | all_plots_docbook.xsl |
---|
| 251 | java com.icl.saxon.StyleSheet -o all_plots.html all_plots_${$}.xml \ |
---|
| 252 | /sw/share/xml/xsl/docbook-xsl/html/docbook.xsl \ |
---|
| 253 | section.autolabel=1 html.stylesheet="saxo.css" css.decoration=1 |
---|
| 254 | rm -f all_plots_${$}.xml |
---|
[88] | 255 | # not very nice... but useful !! |
---|
| 256 | sed -e s/".png\""/".png?format=raw\""/g ${1}.html > ${1}_${$}.html |
---|
| 257 | mv ${1}_${$}.html ${1}.html |
---|
[79] | 258 | ;; |
---|
[94] | 259 | main) |
---|
| 260 | sed -e s?"../../saxo/browser/trunk/SRC/Documentation/xmldoc/"??g \ |
---|
[100] | 261 | -e s?"../../saxo/browser/trunk/SRC/Documentation/idldoc_html_output/"?"../idldoc_html_output/"?g \ |
---|
[94] | 262 | -e s?"../../saxo/browser/trunk"?"http://forge.ipsl.jussieu.fr/saxo/browser/trunk"?g \ |
---|
| 263 | ${1}.html > ${1}_${$}.html |
---|
| 264 | mv ${1}_${$}.html ${1}.html |
---|
| 265 | ;; |
---|
[79] | 266 | esac |
---|
| 267 | rm -f ${1}_${$}.xml |
---|