commit: bf07fbe382a4a04c65dd76f286bcc061ba11728b
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Jun 18 11:09:13 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 18 20:00:59 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=bf07fbe3
emerge-webrsync: improve check_file_signature_gpg() diagnostics for missing keys
Presently, the check_file_signature_gpg() function shows the same
diagnostic messages in the event of a missing key, irrespective of
whether PORTAGE_GPG_KEY was defined or not. Disambiguate by showing
distinct messages for both cases.
If PORTAGE_GPG_KEY is unset/empty:
* Checking signature ...
* sec-keys/openpgp-keys-gentoo-release does not appear to be installed
emerge-webrsync: '/usr/share/openpgp-keys/gentoo-release.asc' does not exist
(or is not a file)
If PORTAGE_GPG_KEY is non-empty:
* Checking signature ...
* PORTAGE_GPG_KEY does not appear to have been set correctly
emerge-webrsync: '/var/empty/nonexistent.key' does not exist (or is not a file)
Further, employ the ${param@Q} form of expansion so as to ensure that
all pathnames are legible, and that control characters and (some)
whitespace characters are not printed in their raw form. Doing so is
acceptable, given a target of >=bash-4.4.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/emerge-webrsync | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 8e0619e69c..7140a757db 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -289,9 +289,13 @@ check_file_signature_gpg() {
key="${EPREFIX}/usr/share/openpgp-keys/gentoo-release.asc"
fi
- if [[ ! -f "${key}" ]] ; then
- eerror "${key} not available. Is
sec-keys/openpgp-keys-gentoo-release installed?"
- die "Needed keys unavailable! Install its package or set
PORTAGE_GPG_KEY to the right path."
+ if [[ ! -f "${key}" ]]; then
+ if [[ ${PORTAGE_GPG_KEY} ]]; then
+ eerror "PORTAGE_GPG_KEY does not appear to have been
set correctly"
+ else
+ eerror "sec-keys/openpgp-keys-gentoo-release does not
appear to be installed"
+ fi
+ die "${key@Q} does not exist (or is not a file)"
fi
if [[ ! ${GNUPGHOME=${PORTAGE_GPG_DIR}} ]]; then