mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-07 14:12:57 -04:00
tools: use either sha256sum or shasum
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
This commit is contained in:
parent
5deccc3d01
commit
7d55e67f5c
1 changed files with 15 additions and 1 deletions
|
@ -33,8 +33,22 @@ ensure_pseudo_version_tool() {
|
||||||
if [[ ! -f "${REPOSITORY_ROOT}/tools/pseudo-version" ]]; then
|
if [[ ! -f "${REPOSITORY_ROOT}/tools/pseudo-version" ]]; then
|
||||||
get_pseudo_version_tool
|
get_pseudo_version_tool
|
||||||
fi
|
fi
|
||||||
|
|
||||||
expected=$(cat "${REPOSITORY_ROOT}/tools/pseudo_version_$(goos)_$(goarch).sha256")
|
expected=$(cat "${REPOSITORY_ROOT}/tools/pseudo_version_$(goos)_$(goarch).sha256")
|
||||||
if ! shasum -a 256 -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version"); then
|
|
||||||
|
local need_pseudo_version_tool=0
|
||||||
|
if type sha256sum > /dev/null 2>&1; then
|
||||||
|
sha256sum -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version")
|
||||||
|
need_pseudo_version_tool=$?
|
||||||
|
elif type shasum > /dev/null 2>&1; then
|
||||||
|
shasum -a 256 -c --status <(echo "${expected} ${REPOSITORY_ROOT}/tools/pseudo-version")
|
||||||
|
need_pseudo_version_tool=$?
|
||||||
|
else
|
||||||
|
echo "sha256sum or shasum is required to verify the pseudo-version tool" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ${need_pseudo_version_tool} -ne 0 ]]; then
|
||||||
get_pseudo_version_tool
|
get_pseudo_version_tool
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue