From: Ian Jackson Date: Sun, 12 Sep 2010 18:21:36 +0000 (+0100) Subject: website: upload: centralise download url generation X-Git-Tag: 6.7.0~14^2~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=45f5bb2ff2c8a6a2487f471bcb0c6617dc0f9bb0 website: upload: centralise download url generation --- diff --git a/yarrg/web/upload b/yarrg/web/upload index 0c8eefd..0b55d4d 100755 --- a/yarrg/web/upload +++ b/yarrg/web/upload @@ -34,11 +34,20 @@ <& docshead &> -<%perl> +<%shared> my $url_base_base= 'http://yarrg.chiark.net/download/jarrg'; -my $download_version= 'test'; -my $url_base= "$url_base_base/$download_version"; - + +<%def downloadurl><%args> +$leaf +$test => 1 +# ^ change this to change the default version +<%perl> +my $download_version= $test ? '/test' : ''; +my $url_base= "$url_base_base$download_version"; +my $url= $url_base.'/'.$leaf; +<% + $m->has_content ? $m->content : $url +%>

Uploading to YARRG

@@ -96,7 +105,7 @@ report the problem to us, not to Three Rings.

Installing and running on Linux

Download -<% $url_base %>/jarrg.tar.gz +<& downloadurl, leaf => 'jarrg.tar.gz' &> and unpack it. You run jarrg from the command line. Change (cd) to the top level jarrg directory which was created when you unpacked the tarball, and then run @@ -110,7 +119,7 @@ ordinary Puzzle Pirates startup script, which is normally

Installing on Windows

Download -<% $url_base %>/jarrg-setup.exe +<& downloadurl, leaf => 'jarrg-setup.exe' &> and double-click on it. It will either:
  1. Just work, in which case you'll have a new icon on your desktop which @@ -184,13 +193,13 @@ the MIT-style two-clause licence. The download directory can contains other versions (eg unreleased test versions), which you can see here: - <% $url_base_base %>/ . + <& downloadurl, leaf => '', test => 0 &>

    The source code for the downloadable released binaries is in the -Linux -tarball. We maintain JARRG in git, and you can get +<&| downloadurl, leaf=>'jarrg.tar.gz' &>Linux tarball. +We maintain JARRG in git, and you can get source code for recent and perhaps unreleased versions from one of:

     git://git.yarrg.chiark.net/jarrg-ian.git (gitweb)