aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rwxr-xr-xgen-download-page.sh28
2 files changed, 29 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 0236d34..b821ef2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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>"