]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
opensuse: Simplify GPG logic
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 Jan 2026 18:22:41 +0000 (19:22 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 Jan 2026 18:46:23 +0000 (19:46 +0100)
No need to check ourselves, we can delegate the check to find_rpm_gpgkey()
instead.

mkosi/distribution/opensuse.py

index 039398f17f1b56016f922f6706b881b7b5b44dca..9e813fbb59346abf514ed838f80adda941f49f2c 100644 (file)
@@ -92,15 +92,9 @@ class Installer(DistributionInstaller, distribution=Distribution.opensuse):
             gpgkeys = tuple(
                 p
                 for key in ("RPM-GPG-KEY-openSUSE-Tumbleweed", "RPM-GPG-KEY-openSUSE")
-                if (p := find_rpm_gpgkey(context, key, required=False))
+                if (p := find_rpm_gpgkey(context, key, required=not context.config.repository_key_fetch))
             )
 
-            if not gpgkeys and not context.config.repository_key_fetch:
-                die(
-                    "openSUSE GPG keys not found in /usr/share/distribution-gpg-keys",
-                    hint="Make sure the distribution-gpg-keys package is installed",
-                )
-
             if context.config.snapshot:
                 if context.config.architecture != Architecture.x86_64:
                     die(f"Snapshot= is only supported for x86-64 on {cls.pretty_name()}")