aboutsummaryrefslogtreecommitdiffstats
path: root/util/get-and-check
diff options
context:
space:
mode:
Diffstat (limited to 'util/get-and-check')
-rwxr-xr-xutil/get-and-check17
1 files changed, 17 insertions, 0 deletions
diff --git a/util/get-and-check b/util/get-and-check
new file mode 100755
index 0000000..da9f1aa
--- /dev/null
+++ b/util/get-and-check
@@ -0,0 +1,17 @@
+#!/bin/sh
+# See LICENSE file for copyright and license details.
+
+set -e
+
+if ! test $# = 3; then
+ printf 'usage: %s tarball-url reference-dir work-dir\n' "$0" >&2
+ exit 1
+fi
+
+utildir="$(dirname -- "$0")"
+tarball="$3/download-$$.tar.gz"
+
+curl -sL -- "$1" > "${tarball}"
+"${utildir}"/validate-tarball "${tarball}" "$2" "$3"
+"${utildir}"/get-checksums "${tarball}"
+rm -f -- "${tarball}"