From e2447322e0be4eddb84196f05952f91fa3c6f37e Mon Sep 17 00:00:00 2001 From: Roman Perepelitsa Date: Tue, 2 Nov 2021 07:23:57 +0100 Subject: Squashed 'gitstatus/' changes from eaf430112..e26996460 e26996460 survive broken shasum b1825b29a make bash bindings work with nounset git-subtree-dir: gitstatus git-subtree-split: e269964607042ef0fdbda2d7af74ef9c8f618cf4 --- install | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'install') diff --git a/install b/install index 981d280a..a0142b2b 100755 --- a/install +++ b/install @@ -304,27 +304,29 @@ END local data_file="$tmpdir"/"$1".tar.gz local hash_file="$tmpdir"/"$1".tar.gz.sha256 local hash= - if command -v shasum >/dev/null 2>/dev/null; then - if run_cmd shasum -b -a 256 -- "$data_file" >"$hash_file"; then - IFS= read -r hash <"$hash_file" || hash= - hash="${hash%% *}" - fi - elif command -v sha256sum >/dev/null 2>/dev/null; then - if run_cmd sha256sum -b -- "$data_file" >"$hash_file"; then - IFS= read -r hash <"$hash_file" || hash= - hash="${hash%% *}" - fi - elif command -v sha256 >/dev/null 2>/dev/null; then - if run_cmd sha256 -- "$data_file" "$hash_file"; then - IFS= read -r hash <"$hash_file" || hash= - # Ignore sha256 output if it's from hashalot. It's incompatible. - if [ ${#hash} -lt 64 ]; then - hash= - else - hash="${hash##* }" - fi - fi - fi + { + command -v shasum >/dev/null 2>/dev/null && + run_cmd shasum -b -a 256 -- "$data_file" >"$hash_file" /dev/null 2>/dev/null && + run_cmd sha256sum -b -- "$data_file" >"$hash_file" /dev/null 2>/dev/null && + run_cmd sha256 -- "$data_file" >"$hash_file"