~kaction/config

ref: cae7bd4c8c0af6ac8a86e7bd2b778bd0d094cd99 config/aux/fetch -rwxr-xr-x 276 bytes
cae7bd4c — Dmitry Bogatov Simplify build system: avoid dependency on net 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh -eu
url="$1"
filename="$2"
want="${3}"

wget "$url" -qO "$filename"

real=$(sha1sum < "${filename}" | cut -f1 -d' ')

case "${real}" in
    (${want}*) ;;
    (*)
        printf >&2 'Hashsum mismatch: %s, not %s...' "${real}" "${want}"
        exit 1
        ;;
esac