summaryrefslogtreecommitdiff
path: root/pkg/git
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-04-15 18:44:00 -0700
committerMichael Forney <mforney@mforney.org>2020-04-15 19:09:56 -0700
commit3c7d1aadfbe558bdee90ff73ff63a721d1db7da5 (patch)
tree2bb5f0ff827cbcfe9d208c68e71933ac470d7781 /pkg/git
parent7db12b30b2580490b768bfc28a7dcc10f8cda857 (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 'pkg/git')
-rw-r--r--pkg/git/fetch.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkg/git/fetch.sh b/pkg/git/fetch.sh
index 48edce2c..7e257f44 100644
--- a/pkg/git/fetch.sh
+++ b/pkg/git/fetch.sh
@@ -1,3 +1,6 @@
+: ${SHA256SUM:=sha256sum}
+: ${PAXREAD:=pax -r}
+
set -e
(. ./scripts/fetch-git.sh "$@")
@@ -9,10 +12,10 @@ if [ -e src/man ] ; then
rm -rf src/man
fi
-if ! sha256sum -c sha256 2>/dev/null ; then
+if ! $SHA256SUM -c sha256 2>/dev/null ; then
curl -L -O -K url
- sha256sum -c sha256
+ $SHA256SUM -c sha256
fi
read -r checksum archive <sha256
-xzcat "$archive" | ${PAXREAD:-pax -r} -s ',^\.,src/man,'
+xzcat "$archive" | $PAXREAD -s ',^\.,src/man,'