From b8a52d883ff6160dadd9895f8a1a7522a2e607d9 Mon Sep 17 00:00:00 2001 From: just_fun Date: Sat, 23 Sep 2017 23:46:13 +0300 Subject: [PATCH] pkgmk: show the complete error message from signify The signify tool outputs: signify: ... or file: FAIL When signify failed, the old behaviour of pkgmk was to show: MISMATCH: unless the output was "signify: signature verification failed", in which case it displayed the "Failed verifying cryptographic digest" error message. This made all signify errors to be displayed as "MISMATCH: signify". The new behaviour is to consider any message starting with "signify: [a-z]..." as an error message, and displayed in full. The small letter check is to avoid considering "signify: FAIL" (the file 'signify' has a different checksum) as an error message. A side effect will be that the error message Failed verifying cryptographic digest is changed into signature verification failed --- pkgmk.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgmk.in b/pkgmk.in index 251a577..3a7d166 100755 --- a/pkgmk.in +++ b/pkgmk.in @@ -308,8 +308,9 @@ check_signature() { cd $PKGMK_ROOT if [ $RESULT -ne 0 ]; then - if [ "$err" = "signify: signature verification failed" ]; then - error "Failed verifying cryptographic digest" + local reErr="^signify: ([a-z].*)" + if [[ $err =~ $reErr ]]; then + error "${BASH_REMATCH[1]}" else error "Signature mismatch found:" echo "$err" | while read n; do echo 'MISMATCH '${n%%:*}; done -- 2.14.1