aboutsummaryrefslogtreecommitdiffstats
path: root/gen-download-page.sh
blob: 6b114901f5e4f9d495889e84f5bd41d764cf337e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

project='librb'
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}/!"
echo "</pre>"