]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Merge pull request #3873 from DaanDeMeyer/snapshot-split main
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 22 Aug 2025 23:17:31 +0000 (01:17 +0200)
committerGitHub <noreply@github.com>
Fri, 22 Aug 2025 23:17:31 +0000 (01:17 +0200)
1  2 
mkosi/distributions/rhel.py

index 3e95a489a3918331227b68164ab561ec9391de04,9e187db90eeb4fba15a64436723bbddbec793217..5a1bb0ba2963443ddf28d90ebe854862a3f949b2
@@@ -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/"