kiss: Fix crash caused by sh256(). Closes #204

This commit is contained in:
Dylan Araps 2020-11-25 08:49:32 +02:00
parent 58846c99b1
commit 16b2e1be75
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 11 additions and 9 deletions

4
kiss
View File

@ -113,8 +113,9 @@ sh256() {
# All utilities must match 'sha256sum' output.
#
# Example: '<checksum> <file>'
[ -f "$1" ] || return 0
# Skip non-files and broken symlinks.
if { [ -h "$1" ] && [ -e "$1" ] } || [ -f "$1" ]; then
hash=$(
sha256sum "$1" ||
sha256 -r "$1" ||
@ -124,6 +125,7 @@ sh256() {
)
printf '%s\n' "${hash%% *}"
fi
}
pkg_lint() {