diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-13 10:44:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-13 10:44:38 -0300 |
commit | 4bd731cffd71844fb25a058d519aaff9a1a0683e (patch) | |
tree | fba0b2e19d47b52ef61bdec5527bcc58ab492591 | |
parent | f8e396ec95114c279393f76ba0473e6ca5dc4e46 (diff) | |
download | puppet-pmwiki-4bd731cffd71844fb25a058d519aaff9a1a0683e.tar.gz puppet-pmwiki-4bd731cffd71844fb25a058d519aaff9a1a0683e.tar.bz2 |
Getting the latest release automatically (2)
-rw-r--r-- | templates/pmwiki.sh.erb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/templates/pmwiki.sh.erb b/templates/pmwiki.sh.erb index f978182..2fef04b 100644 --- a/templates/pmwiki.sh.erb +++ b/templates/pmwiki.sh.erb @@ -17,15 +17,16 @@ function pmwiki_check_existing { # Deploy a fresh pmwiki tree function pmwiki_deploy { if [ "$#" != "1" ]; then - latest="`lynx -dump http://www.pmwiki.org/pub/pmwiki/ 2> /dev/null | grep ".tgz$" | grep -v latest | sed -e 's/^.* http/http/' | head -1`" + new="`lynx -dump http://www.pmwiki.org/pub/pmwiki/ 2> /dev/null | grep ".tgz$" | grep -v latest | sed -e 's/^.*-//' | head -1`" - if [ -z "$latest" ]; then + if [ -z "$new" ]; then echo "Unable to determine latest release, please specify it manually:" echo "Usage: `basename $0` deploy <version>" + else + new="`basename $new .tgz`" fi else new="$1" - latest="http://pmwiki.org/pub/pmwiki/pmwiki-$new.tgz" fi # Setup @@ -33,7 +34,7 @@ function pmwiki_deploy { pmwiki_check_existing $new # Deploy a fresh pmwiki tree - wget $latest + wget http://pmwiki.org/pub/pmwiki/pmwiki-$new.tgz wget http://pmwiki.org/pub/pmwiki/i18n/i18n-all.zip tar zxvf pmwiki-$new.tgz && rm pmwiki-$new.tgz ( cd pmwiki-$new && unzip -o ../i18n-all.zip && rm $_ ) |