pkgmeek: accommodate verbose output from signify

This commit is contained in:
John McQuah 2023-08-20 19:52:16 -04:00
parent a9fb36fff0
commit ab4a9ee6fd

View File

@ -446,7 +446,7 @@ parse_signify_output() { # chomps the output of check_signature()
*"Pkgfile verification failed")
signerr=-1; error "Signature missing! Unable to authenticate the Pkgfile."
;;
*"verification failed")
*"verification failed"*)
signerr=1; error "Signature file corrupted or unreadable."
;;
*"FAIL")
@ -464,6 +464,7 @@ check_signature() { # called from $PKGMK_ROOT in the case "when"="pre-Pkgfile",
local reqfiles=(Pkgfile); local s=0; local when="$1";
local SIGNIFY_ARGS=(-C -x "$PKGMK_ROOT/.signature")
[ "$PKGMK_PUBLICKEY" ] || PKGMK_PUBLICKEY="$(get_repo_key public)"
if [ -f "$PKGMK_ROOT/.signature" ]; then
[ "$when" = "pre-Pkgfile" ] || reqfiles=(.footprint)
while [ "$when" = "pre-build" ] && (( s < ${#_local_[@]} )); do
@ -473,8 +474,7 @@ check_signature() { # called from $PKGMK_ROOT in the case "when"="pre-Pkgfile",
for FILE in "${reqfiles[@]}"; do
[ -e "$FILE" ] || ln -sf "$PKGMK_ROOT/$FILE" .
done
[ "$PKGMK_PUBLICKEY" ] && [ -r "$PKGMK_PUBLICKEY" ] && \
SIGNIFY_ARGS+=(-p "$PKGMK_PUBLICKEY")
[ -r "$PKGMK_PUBLICKEY" ] && SIGNIFY_ARGS+=(-p "$PKGMK_PUBLICKEY")
/usr/bin/signify "${SIGNIFY_ARGS[@]}" "${reqfiles[@]}" 2>&1
else
[ "$when" = "pre-Pkgfile" ] && echo "Pkgfile verification failed"