#!/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}"