diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | gen-download-page.sh | 28 |
2 files changed, 29 insertions, 0 deletions
@@ -1,5 +1,6 @@ *.o example www/manuals +www/downloads.html www/out mtest-*.tar.gz diff --git a/gen-download-page.sh b/gen-download-page.sh new file mode 100755 index 0000000..b65e74e --- /dev/null +++ b/gen-download-page.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +project='mtest' +out='www/downloads.html' +remote="http://distfiles.kurwinet.pl/${project}" + +# extract links to files +links="$(curl "${remote}/" 2>/dev/null \ + | grep "${project}-[0-9]*\.[0-9]*\.[0-9]*\." | sort -r)" + +exec 1<&- +exec 1<>"${out}" + +echo > "${out}" +echo "<h1>downloads</h1>" +echo "<h2>git</h2>" +echo "<p>" +echo "git clone git@kurwinet.pl:${project}<br>" +echo "git clone git://kurwinet.pl/${project}<br>" +echo "git clone http://git.kurwinet.pl/${project}<br>" +echo "</p>" + +echo "<h2>tarballs</h2>" +echo "<pre>" + +# convert links to absolute +echo "${links}" | sed "s:a href=\":a href=\"${remote_sed}/:" +echo "</pre>" |