From: Daan De Meyer Date: Mon, 26 Aug 2024 09:41:54 +0000 (+0200) Subject: azure: Deal with repository changes X-Git-Tag: v25~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0804b8153f3ec9dce3e3acc8c605cb892e038ca9;p=thirdparty%2Fmkosi.git azure: Deal with repository changes The preview repositories are now a layer on top of the prod repositories, so let's adapt mkosi to that. --- diff --git a/mkosi.conf.d/20-azure.conf b/mkosi.conf.d/20-azure.conf index 6dc333a56..6283a7d69 100644 --- a/mkosi.conf.d/20-azure.conf +++ b/mkosi.conf.d/20-azure.conf @@ -4,7 +4,8 @@ Distribution=azure [Distribution] -Release=3.0-preview +Release=3.0 +Repositories=base-preview [Content] # The unsigned-shim package tries to install to the same location as the signed shim package so we can't install and diff --git a/mkosi/distributions/azure.py b/mkosi/distributions/azure.py index 17f172cab..83e8d2bb0 100644 --- a/mkosi/distributions/azure.py +++ b/mkosi/distributions/azure.py @@ -21,7 +21,7 @@ class Installer(fedora.Installer): @classmethod def default_release(cls) -> str: - return "3.0-prod" + return "3.0" @classmethod def filesystem(cls) -> str: @@ -52,26 +52,33 @@ class Installer(fedora.Installer): return mirror = context.config.mirror or "https://packages.microsoft.com/azurelinux" + url = join_mirror(mirror, context.config.release) - if any(context.config.release.endswith(f"-{suffix}") for suffix in ("prod", "preview")): - rel = context.config.release - else: - rel = f"{context.config.release}-prod" - - url = join_mirror(mirror, rel.replace("-", "/")) - - nvidia = "nvidia" if rel.endswith("-prod") else "NVIDIA" - for repo in ("base", "extended", "ms-oss", "ms-non-oss", "cloud-native", nvidia): + for repo in ("base", "extended", "ms-oss", "ms-non-oss", "cloud-native", "nvidia"): yield RpmRepository( repo, - f"baseurl={url}/{repo}/$basearch", + f"baseurl={url}/prod/{repo}/$basearch", + gpgurls, + ) + + repo = "NVIDIA" if repo == "nvidia" else repo + yield RpmRepository( + f"{repo}-preview", + f"baseurl={url}/preview/{repo}/$basearch", gpgurls, + enabled=False, ) for repo in ("base", "cloud-native", "extended"): yield RpmRepository( f"{repo}-debuginfo", - f"baseurl={url}/{repo}/debuginfo/$basearch", + f"baseurl={url}/prod/{repo}/debuginfo/$basearch", + gpgurls, + enabled=False, + ) + yield RpmRepository( + f"{repo}-preview-debuginfo", + f"baseurl={url}/preview/{repo}/debuginfo/$basearch", gpgurls, enabled=False, ) @@ -79,7 +86,13 @@ class Installer(fedora.Installer): for repo in ("base", "cloud-native", "extended", "ms-oss"): yield RpmRepository( f"{repo}-source", - f"baseurl={url}/{repo}/srpms", + f"baseurl={url}/prod/{repo}/srpms", + gpgurls, + enabled=False, + ) + yield RpmRepository( + f"{repo}-source", + f"baseurl={url}/preview/{repo}/srpms", gpgurls, enabled=False, )