From: Daan De Meyer Date: Tue, 4 Jul 2023 10:36:39 +0000 (+0200) Subject: centos: Add Special Interest Group (SIG) repositories X-Git-Tag: v15~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f126e73ad03f1f1a1dd75ffb29fa1c3206b89535;p=thirdparty%2Fmkosi.git centos: Add Special Interest Group (SIG) repositories See https://wiki.centos.org/SpecialInterestGroup for more information on SIGs. This commit only adds the Hyperscale SIG repositories. More can be added later on an as-needed basis. --- diff --git a/mkosi/distributions/centos.py b/mkosi/distributions/centos.py index aa43ce5f5..5c84f3f0a 100644 --- a/mkosi/distributions/centos.py +++ b/mkosi/distributions/centos.py @@ -140,6 +140,38 @@ class CentosInstaller(DistributionInstaller): def _mirror_repo_url(cls, repo: str) -> str: return f"http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo={repo}" + @classmethod + def _sig_repos(cls, config: MkosiConfig, release: int) -> list[Repo]: + if config.local_mirror or config.distribution != Distribution.centos: + return [] + + sigs = ( + ( + "hyperscale", + (f"packages-{c}" for c in ("main", "experimental", "facebook", "hotfixes", "spin", "intel")), + "https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-HyperScale", + ), + ) + + repos = [] + + for sig, components, gpgurl in sigs: + for c in components: + if config.mirror: + if release <= 8: + url = f"baseurl={config.mirror}/centos/$stream/{sig}/$basearch/{c}" + else: + url = f"baseurl={config.mirror}/SIGs/$stream/{sig}/$basearch/{c}" + else: + if release <= 8: + url = f"mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo={sig}-{c}" + else: + url = f"metalink=https://mirrors.centos.org/metalink?repo=centos-{sig}-sig-{c}-$stream&arch=$basearch" + + repos += [Repo(f"{sig}-{c}", url, [gpgurl], enabled=False)] + + return repos + @classmethod def _epel_repos(cls, config: MkosiConfig) -> list[Repo]: epel_gpgurl = "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever" @@ -202,7 +234,7 @@ class CentosInstaller(DistributionInstaller): if url: repos += [Repo(name, url, [gpgurl])] - return repos + cls._epel_repos(config) + return repos + cls._epel_repos(config) + cls._sig_repos(config, release) @classmethod def _stream_repos(cls, config: MkosiConfig, release: int) -> list[Repo]: @@ -233,4 +265,4 @@ class CentosInstaller(DistributionInstaller): if url: repos += [Repo(name, url, [gpgurl])] - return repos + cls._epel_repos(config) + return repos + cls._epel_repos(config) + cls._sig_repos(config, release)