From: Antonio Alvarez Feijoo Date: Tue, 18 Nov 2025 13:15:16 +0000 (+0100) Subject: opensuse: fix mirror URL for Leap >= 16.0 X-Git-Tag: v26~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bababf4212d2e682a4e57e4b2feea3890066132;p=thirdparty%2Fmkosi.git opensuse: fix mirror URL for Leap >= 16.0 Starting with Leap 16.0, there will not be a dedicated update repository. Fixes #3990 --- diff --git a/mkosi/distribution/opensuse.py b/mkosi/distribution/opensuse.py index 44e4c3a68..498520142 100644 --- a/mkosi/distribution/opensuse.py +++ b/mkosi/distribution/opensuse.py @@ -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: