commit:     68f4ea8a90d8759a1aa859d9188017e21797bdd0
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 16 01:08:36 2024 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Jan 16 05:25:20 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=68f4ea8a

Handle SignatureException during package moves

Ignore package moves for packages that raise SignatureException,
just as they are ignored for packages that have a valid signature.

Bug: https://bugs.gentoo.org/922142
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/dbapi/bintree.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 2342d571b9..ee574f435f 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -296,8 +296,12 @@ class bindbapi(fakedbapi):
             encoding_key = True
         elif binpkg_format == "gpkg":
             mybinpkg = portage.gpkg.gpkg(self.settings, cpv_str, binpkg_path)
-            mydata = mybinpkg.get_metadata()
-            if mybinpkg.signature_exist:
+            try:
+                mydata = mybinpkg.get_metadata()
+                signature_exist = mybinpkg.signature_exist
+            except SignatureException:
+                signature_exist = True
+            if signature_exist:
                 writemsg(
                     colorize(
                         "WARN",
@@ -721,8 +725,12 @@ class binarytree:
                 decode_metadata_name = False
             elif binpkg_format == "gpkg":
                 mybinpkg = portage.gpkg.gpkg(self.settings, mycpv, binpkg_path)
-                mydata = mybinpkg.get_metadata()
-                if mybinpkg.signature_exist:
+                try:
+                    mydata = mybinpkg.get_metadata()
+                    signature_exist = mybinpkg.signature_exist
+                except SignatureException:
+                    signature_exist = True
+                if signature_exist:
                     writemsg(
                         colorize(
                             "WARN",

Reply via email to