aboutsummaryrefslogtreecommitdiffstats
path: root/add-github-mirror
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-29 21:23:13 +0200
committerMattias Andrée <m@maandree.se>2026-05-29 21:23:13 +0200
commit71d8bd925ecb1015b94bce5f8726e397022f2a8f (patch)
treeb451255281bc4e428d7c60995f0f17f867e2e84f /add-github-mirror
parentFix error handling and make util/ setup and domain agnostic (diff)
downloadrelease-scripts-master.tar.gz
release-scripts-master.tar.bz2
release-scripts-master.tar.xz
Add add-github-mirrorHEADmaster
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rwxr-xr-xadd-github-mirror27
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}"