mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-11-04 14:05:41 -07:00
kiss: Fix crash caused by sh256(). Closes #204
This commit is contained in:
parent
58846c99b1
commit
16b2e1be75
20
kiss
20
kiss
@ -113,17 +113,19 @@ sh256() {
|
||||
# All utilities must match 'sha256sum' output.
|
||||
#
|
||||
# Example: '<checksum> <file>'
|
||||
[ -f "$1" ] || return 0
|
||||
|
||||
hash=$(
|
||||
sha256sum "$1" ||
|
||||
sha256 -r "$1" ||
|
||||
openssl dgst -sha256 -r "$1" ||
|
||||
shasum -a 256 "$1" ||
|
||||
digest -a sha256 "$1"
|
||||
)
|
||||
# Skip non-files and broken symlinks.
|
||||
if { [ -h "$1" ] && [ -e "$1" ] } || [ -f "$1" ]; then
|
||||
hash=$(
|
||||
sha256sum "$1" ||
|
||||
sha256 -r "$1" ||
|
||||
openssl dgst -sha256 -r "$1" ||
|
||||
shasum -a 256 "$1" ||
|
||||
digest -a sha256 "$1"
|
||||
)
|
||||
|
||||
printf '%s\n' "${hash%% *}"
|
||||
printf '%s\n' "${hash%% *}"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_lint() {
|
||||
|
Loading…
Reference in New Issue
Block a user