]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
opensuse: fix mirror URL for Leap >= 16.0
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 18 Nov 2025 13:15:16 +0000 (14:15 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 18 Nov 2025 14:47:03 +0000 (15:47 +0100)
Starting with Leap 16.0, there will not be a dedicated update repository.

Fixes #3990

mkosi/distribution/opensuse.py

index 44e4c3a68b18747e750391d6e42e5179ea41f1ca..498520142e0ff6080d58335dfe115a7828948b1f 100644 (file)
@@ -16,6 +16,7 @@ from mkosi.installer.zypper import Zypper
 from mkosi.log import die
 from mkosi.mounts import finalize_certificate_mounts
 from mkosi.run import run
+from mkosi.versioncomp import GenericVersion
 
 
 class Installer(DistributionInstaller, distribution=Distribution.opensuse):
@@ -213,30 +214,22 @@ class Installer(DistributionInstaller, distribution=Distribution.opensuse):
                         enabled=False,
                     )
 
-            if context.config.release in ("current", "stable", "leap"):
-                url = join_mirror(mirror, f"{subdir}/update/openSUSE-current")
-                yield RpmRepository(
-                    id="oss-update",
-                    url=f"baseurl={url}",
-                    gpgurls=fetch_gpgurls(context, url) if not zypper else (),
-                )
+            if (
+                context.config.release in ("current", "stable", "leap")
+                or GenericVersion(context.config.release) >= 16
+            ):
+                subdir += f"distribution/{release}/repo"
+            else:
+                subdir += f"update/{release}"
 
-                url = join_mirror(mirror, f"{subdir}/update/openSUSE-non-oss-current")
+            for repo in ("oss", "non-oss"):
+                url = join_mirror(mirror, f"{subdir}/{repo}")
                 yield RpmRepository(
-                    id="non-oss-update",
+                    id=f"{repo}-update",
                     url=f"baseurl={url}",
                     gpgurls=fetch_gpgurls(context, url) if not zypper else (),
-                    enabled=False,
+                    enabled=repo == "oss",
                 )
-            else:
-                for repo in ("oss", "non-oss"):
-                    url = join_mirror(mirror, f"{subdir}/update/{release}/{repo}")
-                    yield RpmRepository(
-                        id=f"{repo}-update",
-                        url=f"baseurl={url}",
-                        gpgurls=fetch_gpgurls(context, url) if not zypper else (),
-                        enabled=repo == "oss",
-                    )
 
     @classmethod
     def architecture(cls, arch: Architecture) -> str: