From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1519172-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 22B4D15806E
	for <garchives@archives.gentoo.org>; Wed, 17 May 2023 06:20:26 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 64AB0E0845;
	Wed, 17 May 2023 06:20:25 +0000 (UTC)
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) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 495B9E0845
	for <gentoo-commits@lists.gentoo.org>; Wed, 17 May 2023 06:20:25 +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 36D28335DB3
	for <gentoo-commits@lists.gentoo.org>; Wed, 17 May 2023 06:20:24 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9C2FD8B7
	for <gentoo-commits@lists.gentoo.org>; Wed, 17 May 2023 06:20:22 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
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" <sam@gentoo.org>
Message-ID: <1684304412.b444a4baa113dcf9f779fa68b056b8ac5e9ea5ea.sam@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: /, bin/
X-VCS-Repository: proj/portage
X-VCS-Files: NEWS bin/emerge-webrsync
X-VCS-Directories: bin/ /
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: b444a4baa113dcf9f779fa68b056b8ac5e9ea5ea
X-VCS-Branch: master
Date: Wed, 17 May 2023 06:20:22 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 43084290-2a5e-4d29-a8ed-0165de1dd91a
X-Archives-Hash: c8152c20b6ce874b1a6f9e931d27ddfe

commit:     b444a4baa113dcf9f779fa68b056b8ac5e9ea5ea
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed May 17 06:12:32 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 17 06:20:12 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b444a4ba

emerge-webrsync: fall back correctly to manual gpg if no gemato

Bug: https://bugs.gentoo.org/905868
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                | 3 +++
 bin/emerge-webrsync | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/NEWS b/NEWS
index 505fde7c6..baf1140f8 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,9 @@ Bug fixes:
   both of them now use the same main path for PGP verification (i.e.
   gemato).
 
+* emerge-webrsync: Fall back correctly to manual gpg (rather than aborting
+  entirely) if gemato is not installed (bug #905868).
+
 Cleanups:
 * Convert printf-style %-formats into fstrings.
 

diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index b953624d4..e707f8b9b 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -302,6 +302,8 @@ check_file_signature_gemato() {
 			# a keyring problem).
 			die "signature verification failed"
 		fi
+	else
+		return 127
 	fi
 
 	return "${r}"
@@ -346,6 +348,13 @@ check_file_signature() {
 			1)
 				check_file_signature_gemato "${signature}" "${file}"
 				r=$?
+
+				if [[ ${r} -eq 127 ]] ; then
+					ewarn "Falling back to gpg as gemato is not installed"
+					check_file_signature_gpg_unwrapped "${signature}" "${file}"
+					r=$?
+				fi
+
 				;;
 			2)
 				check_file_signature_gpg_unwrapped "${signature}" "${file}"