aboutsummaryrefslogtreecommitdiffstats
path: root/add-github-mirror
blob: 063cfa59c8cf44e7ca0e49c480cb9feb209cc8cf (plain) (blame)
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
#!/bin/sh
# See LICENSE file for copyright and license details.

set -e

if test ! $# = 2; then
	printf 'usage: %s project version\n' "$0" >&2
	exit 1
fi

die () {
	printf '%s\n' "$@" >&2
	exit 1
}

url="https://github.com/maandree/$1/archive/$2.tar.gz"

tarball=".static/$1-$2.tar.gz"
infofile="rel/$1/$2.info"
sumfile="rel/$1/$2.checksums"
test -e "${tarball}" || die "${tarball} does not exist"
test -e "${infofile}" || die "${infofile} does not exist"
test -e "${sumfile}" || die "${sumfile} does not exist"

checksums="$("$(dirname -- "$0")"/util/add-mirror "${url}" "${tarball}" < ${sumfile})"
printf '%s\n' "${checksums}" > "${sumfile}"
printf 'Tarball: %s\n' "${url}" >> "${infofile}"