From 577701250d645d1fc1a505cde34aedbeb3208ea5 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 11 Oct 2016 23:04:25 +1000 Subject: Use coreutils binaries for checking/generating checksums If pacman is build against a crypto library other than openssl, it makes no sense to require makepkg to use it. The only currently considered alternative to openssl is nettle, which has no binary for base64 encode/decode. This means that we could replace the hashing cacluations with nettle-hash, but would require base64 from coreutils. Given makepkg already relies heavily on coreutils, we might as well use all the coreutils hashing binaries too. This patch also improves the checking of required binaries for hashing operations. Signed-off-by: Allan McRae --- scripts/libmakepkg/integrity/verify_checksum.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/libmakepkg/integrity/verify_checksum.sh.in') diff --git a/scripts/libmakepkg/integrity/verify_checksum.sh.in b/scripts/libmakepkg/integrity/verify_checksum.sh.in index 44a2b2e1..5830aff3 100644 --- a/scripts/libmakepkg/integrity/verify_checksum.sh.in +++ b/scripts/libmakepkg/integrity/verify_checksum.sh.in @@ -82,8 +82,8 @@ verify_integrity_one() { return 1 fi - local realsum="$(openssl dgst -${integ} "$file")" - realsum="${realsum##* }" + local realsum="$("${integ}sum" "$file")" + realsum="${realsum%% *}" if [[ ${expectedsum,,} = "$realsum" ]]; then printf '%s\n' "$(gettext "Passed")" >&2 else -- cgit v1.2.3