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