[345] | 1 | #! /bin/sh |
---|
[85] | 2 | # |
---|
[345] | 3 | # module : |
---|
| 4 | # ++ working on getsaxo.xml before processing for HTML and wiki |
---|
| 5 | # |
---|
[410] | 6 | # TODO |
---|
| 7 | # ==== |
---|
| 8 | # |
---|
| 9 | # file in/out parameters to be usable correctly in makefile |
---|
| 10 | # |
---|
[255] | 11 | # update : |
---|
[123] | 12 | # $Id$ |
---|
[139] | 13 | # |
---|
[345] | 14 | # fplod 2008-04-15T10:53:26Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 15 | # creation from makehtml.sh |
---|
| 16 | # adapation to docbook 5.0 |
---|
[139] | 17 | # |
---|
[65] | 18 | set -u |
---|
[345] | 19 | set -o posix |
---|
[79] | 20 | # |
---|
[100] | 21 | case $( whoami ) in |
---|
| 22 | smasson) |
---|
[345] | 23 | lgforge=smasson |
---|
[100] | 24 | ;; |
---|
| 25 | floseb) |
---|
[345] | 26 | lgforge=smasson |
---|
[100] | 27 | ;; |
---|
| 28 | *) |
---|
[345] | 29 | lgforge=saxo |
---|
[100] | 30 | ;; |
---|
| 31 | esac |
---|
| 32 | # |
---|
[345] | 33 | # size of SRC and DATA with .svn |
---|
| 34 | szallsvn=$( du -sh ../../.. | awk '{print $1}' ) |
---|
| 35 | szallsvn=${szallsvn%*M} |
---|
| 36 | # size of SRC with .svn |
---|
| 37 | szsrcsvn=$( du -sh ../../../SRC | awk '{print $1}' ) |
---|
| 38 | szsrcsvn=${szsrcsvn%*M} |
---|
| 39 | # size of DATA with .svn |
---|
| 40 | szdatasvn=$( du -sh ../../../DATA | awk '{print $1}' ) |
---|
| 41 | szdatasvn=${szdatasvn%*M} |
---|
[65] | 42 | # |
---|
[345] | 43 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" |
---|
[65] | 44 | # |
---|
[345] | 45 | # find the most recent SAXO_SRC_yyyymmddrxxx.tar.gz in |
---|
| 46 | # /ipsl/forge/projets/saxo/download/ |
---|
| 47 | infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
| 48 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
| 49 | szsrc=$(echo ${infosrc} | awk '{print $5}') |
---|
[65] | 50 | # |
---|
[345] | 51 | # ndate is the date in the file SAXO_SRC_*.tar.gz |
---|
| 52 | ndate=${filesrc##*_} |
---|
| 53 | ndate=${ndate%.tar.gz} |
---|
[65] | 54 | # |
---|
[345] | 55 | # find the most recent SAXO_DATA_yyyymmddrxxx.tar.gz in |
---|
| 56 | # /ipsl/forge/projets/saxo/download/ |
---|
| 57 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
| 58 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
| 59 | szdata=$(echo ${infodata} | awk '{print $5}') |
---|
[65] | 60 | # |
---|
[345] | 61 | # ndate2 is the date in the file SAXO_DATA_*.tar.gz |
---|
| 62 | ndate2=${filedata##*_} |
---|
| 63 | ndate2=${ndate2%.tar.gz} |
---|
[65] | 64 | # |
---|
[345] | 65 | sed -e s/"\&date\;"/${ndate}/g \ |
---|
| 66 | -e s/"\&date2\;"/${ndate2}/g \ |
---|
| 67 | -e s/"\&szsrc\;"/${szsrc}/g \ |
---|
| 68 | -e s/"\&szdata\;"/${szdata}/g \ |
---|
| 69 | -e s/"\&szallsvn\;"/${szallsvn}/g \ |
---|
| 70 | -e s/"\&szsrcsvn\;"/${szsrcsvn}/g \ |
---|
| 71 | -e s/"\&szdatasvn\;"/${szdatasvn}/g \ |
---|
| 72 | getsaxo.xml > getsaxo_sed.xml |
---|
[139] | 73 | # |
---|
| 74 | # exit |
---|
| 75 | exit 0 |
---|