aboutsummaryrefslogtreecommitdiffstats
path: root/util/get-and-check
blob: da9f1aa9c2cbdf5cb10f929134894062f60ac8dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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}"