aboutsummaryrefslogtreecommitdiffstats
path: root/gen-checksums
blob: f894a38ef0c937d3886d98df76e5626a2c0bcc30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -e

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

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

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

"$(dirname -- "$0")"/util/gen-checksums "${tarball}" "${gitdir}" < "${infofile}" > "${sumfile}"