diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-13 10:42:07 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-13 10:42:07 -0300 |
commit | f8e396ec95114c279393f76ba0473e6ca5dc4e46 (patch) | |
tree | 4fb54ce11111e0cebfcd9c812891bb08b8f200cc | |
parent | a4a7993eb0b9ea9e72791fae60d52b5642cfb14a (diff) | |
download | puppet-pmwiki-f8e396ec95114c279393f76ba0473e6ca5dc4e46.tar.gz puppet-pmwiki-f8e396ec95114c279393f76ba0473e6ca5dc4e46.tar.bz2 |
Getting the latest release automatically
-rw-r--r-- | templates/pmwiki.sh.erb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/templates/pmwiki.sh.erb b/templates/pmwiki.sh.erb index fbdb544..f978182 100644 --- a/templates/pmwiki.sh.erb +++ b/templates/pmwiki.sh.erb @@ -17,17 +17,23 @@ function pmwiki_check_existing { # Deploy a fresh pmwiki tree function pmwiki_deploy { if [ "$#" != "1" ]; then - echo "Usage: `basename $0` deploy <version>" - exit 1 + latest="`lynx -dump http://www.pmwiki.org/pub/pmwiki/ 2> /dev/null | grep ".tgz$" | grep -v latest | sed -e 's/^.* http/http/' | head -1`" + + if [ -z "$latest" ]; then + echo "Unable to determine latest release, please specify it manually:" + echo "Usage: `basename $0` deploy <version>" + fi + else + new="$1" + latest="http://pmwiki.org/pub/pmwiki/pmwiki-$new.tgz" fi # Setup - new="$1" cd $BASE pmwiki_check_existing $new # Deploy a fresh pmwiki tree - wget http://pmwiki.org/pub/pmwiki/pmwiki-$new.tgz + wget $latest 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 $_ ) |