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}"

Reply via email to