From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 22F2A158074 for ; Wed, 18 Jun 2025 20:01:24 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 0B07F341EE9 for ; Wed, 18 Jun 2025 20:01:24 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id A4BB81104DE; Wed, 18 Jun 2025 20:01:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 9A0171104DE for ; Wed, 18 Jun 2025 20:01:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 43C92341E82 for ; Wed, 18 Jun 2025 20:01:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A4DF729FD for ; Wed, 18 Jun 2025 20:01:14 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1750276859.bf07fbe382a4a04c65dd76f286bcc061ba11728b.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/emerge-webrsync X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: bf07fbe382a4a04c65dd76f286bcc061ba11728b X-VCS-Branch: master Date: Wed, 18 Jun 2025 20:01:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1a0380dc-6cde-47e5-b636-be3a2e37f528 X-Archives-Hash: 367c5fb4d26a45b8254379708edc4adb commit: bf07fbe382a4a04c65dd76f286bcc061ba11728b Author: Kerin Millar plushkava net> AuthorDate: Wed Jun 18 11:09:13 2025 +0000 Commit: Sam James gentoo 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 plushkava.net> Signed-off-by: Sam James 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