From: Daan De Meyer Date: Fri, 22 Aug 2025 23:17:31 +0000 (+0200) Subject: Merge pull request #3873 from DaanDeMeyer/snapshot-split X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;p=thirdparty%2Fmkosi.git Merge pull request #3873 from DaanDeMeyer/snapshot-split --- d51e9cbaa6f46bb6947ac74797010272bcf12cd7 diff --cc mkosi/distributions/rhel.py index 3e95a489a,9e187db90..5a1bb0ba2 --- a/mkosi/distributions/rhel.py +++ b/mkosi/distributions/rhel.py @@@ -60,20 -60,25 +60,25 @@@ class Installer(centos.Installer) if context.config.mirror: return None - pattern = "etc/pki/entitlement/*.pem" - - p = next((p for p in sorted(context.sandbox_tree.glob(pattern)) if "key" not in p.name), None) - if not p: - p = next((p for p in sorted(Path("/").glob(pattern)) if "key" not in p.name), None) - if not p: - die("Entitlement certificate not found in host system or sandbox tree") + glob = "/etc/pki/entitlement/*.pem" + paths = [p for p in glob_in_sandbox(glob, sandbox=context.sandbox()) if "-key.pem" not in p.name] + if not paths: + die( + f"No entitlement certificates found at {glob} in sandbox", + hint="Add an entitlement certificate to the sandbox with SandboxTrees= or mkosi.sandbox/", + ) - return p + return paths[0] @classmethod - def repository_variants(cls, context: Context, repo: str) -> Iterable[RpmRepository]: + def repository_variants( + cls, + context: Context, + gpgurls: tuple[str, ...], + repo: str, + ) -> Iterable[RpmRepository]: if context.config.local_mirror: - yield RpmRepository(repo, f"baseurl={context.config.local_mirror}", cls.gpgurls(context)) + yield RpmRepository(repo, f"baseurl={context.config.local_mirror}", gpgurls) else: mirror = context.config.mirror or "https://cdn.redhat.com/content/dist/"