diff options
| author | Michael Forney <mforney@mforney.org> | 2020-04-15 18:44:00 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-04-15 19:09:56 -0700 |
| commit | 3c7d1aadfbe558bdee90ff73ff63a721d1db7da5 (patch) | |
| tree | 2bb5f0ff827cbcfe9d208c68e71933ac470d7781 /scripts/fetch-curl.sh | |
| parent | 7db12b30b2580490b768bfc28a7dcc10f8cda857 (diff) | |
Allow overriding sha256 command through SHA256SUM
This way, oasis can be bootstrapped on other operating systems by
setting SHA256SUM='shasum -a 256'.
Diffstat (limited to 'scripts/fetch-curl.sh')
| -rw-r--r-- | scripts/fetch-curl.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/fetch-curl.sh b/scripts/fetch-curl.sh index 4604a398..a25c0582 100644 --- a/scripts/fetch-curl.sh +++ b/scripts/fetch-curl.sh @@ -1,3 +1,6 @@ +: ${SHA256SUM:=sha256sum} +: ${PAXREAD:=pax -r} + set -e if [ "$#" != 1 ] ; then @@ -14,9 +17,9 @@ if [ -e src ] ; then rm -rf src fi -if ! sha256sum -c sha256 2>/dev/null ; then +if ! $SHA256SUM -c sha256 2>/dev/null ; then curl -L -K url -O - sha256sum -c sha256 + $SHA256SUM -c sha256 fi while read -r checksum archive ; do @@ -31,7 +34,7 @@ while read -r checksum archive ; do tool= esac if [ -n "$tool" ] ; then - "$tool" "$archive" | ${PAXREAD:-pax -r} -s ',^[^/]*,src,' '*/*' + "$tool" "$archive" | $PAXREAD -s ',^[^/]*,src,' '*/*' fi done <sha256 |
