diff options
Diffstat (limited to '')
| -rwxr-xr-x | add-github-mirror | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/add-github-mirror b/add-github-mirror new file mode 100755 index 0000000..063cfa5 --- /dev/null +++ b/add-github-mirror @@ -0,0 +1,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}" |
