summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-10-12 14:08:54 +0200
committerMichał Górny <mgorny@gentoo.org>2024-10-16 06:54:29 +0200
commit0dbf54a0490c0270e4e743e8af8f6b51603bad3c (patch)
treedcc504e8bee38e6da6512e007b115526e9106f80 /eclass
parentsec-keys/sigstore-trusted-root: New package, v0_p20241016 (diff)
downloadgentoo-0dbf54a0490c0270e4e743e8af8f6b51603bad3c.tar.gz
gentoo-0dbf54a0490c0270e4e743e8af8f6b51603bad3c.tar.bz2
gentoo-0dbf54a0490c0270e4e743e8af8f6b51603bad3c.zip
verify-sig.eclass: Refactor code to use extra_args for all types
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/verify-sig.eclass11
1 files changed, 8 insertions, 3 deletions
diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass
index b74ed78290aa..d601c7838a00 100644
--- a/eclass/verify-sig.eclass
+++ b/eclass/verify-sig.eclass
@@ -132,7 +132,6 @@ verify-sig_verify_detached() {
fi
local extra_args=()
- [[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} == yes ]] || extra_args+=( -R )
if [[ -n ${VERIFY_SIG_OPENPGP_KEYSERVER+1} ]]; then
[[ ${VERIFY_SIG_METHOD} == openpgp ]] ||
die "${FUNCNAME}: VERIFY_SIG_OPENPGP_KEYSERVER is not supported"
@@ -152,10 +151,15 @@ verify-sig_verify_detached() {
einfo "Verifying ${filename} ..."
case ${VERIFY_SIG_METHOD} in
minisig)
- minisign -V -P "$(<"${key}")" -x "${sig}" -m "${file}" ||
+ minisign "${extra_args[@]}" \
+ -V -P "$(<"${key}")" -x "${sig}" -m "${file}" ||
die "minisig signature verification failed"
;;
openpgp)
+ if [[ ${VERIFY_SIG_OPENPGP_KEY_REFRESH} != yes ]]; then
+ extra_args+=( -R )
+ fi
+
# gpg can't handle very long TMPDIR
# https://bugs.gentoo.org/854492
local -x TMPDIR=/tmp
@@ -165,7 +169,8 @@ verify-sig_verify_detached() {
die "PGP signature verification failed"
;;
signify)
- signify -V -p "${key}" -m "${file}" -x "${sig}" ||
+ signify "${extra_args[@]}" \
+ -V -p "${key}" -m "${file}" -x "${sig}" ||
die "Signify signature verification failed"
;;
esac