]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
centos: Add extras repo on centos stream 9
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 17 Jan 2023 12:23:52 +0000 (13:23 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 17 Jan 2023 13:33:32 +0000 (14:33 +0100)
We already add the extras repository on centos stream 8, let's do
the same on centos stream 9.

mkosi/distributions/alma.py
mkosi/distributions/centos.py
mkosi/distributions/rocky.py

index 4c54de8951850a93e90c13c64115fddb930a901a..9e08f6c8741173cd4bb0aa51a48ad2ded303e9a2 100644 (file)
@@ -13,6 +13,13 @@ class AlmaInstaller(CentosInstaller):
             "https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-$releasever",
         )
 
+    @staticmethod
+    def _extras_gpg_locations(epel_release: int) -> tuple[Path, str]:
+        return (
+            Path("/etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux-$releasever"),
+            "https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-$releasever",
+        )
+
     @classmethod
     def _mirror_directory(cls) -> str:
         return "almalinux"
index f55e8612219dae89adab7e6367567500a4e11980..4a67577ae6a9401937bba4f31a1219ddc092e9a4 100644 (file)
@@ -111,6 +111,13 @@ class CentosInstaller(DistributionInstaller):
             "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever",
         )
 
+    @staticmethod
+    def _extras_gpg_locations(epel_release: int) -> tuple[Path, str]:
+        return (
+            Path("/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512"),
+            "https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Extras"
+        )
+
     @classmethod
     def _mirror_directory(cls) -> str:
         return "centos"
@@ -173,24 +180,29 @@ class CentosInstaller(DistributionInstaller):
 
         gpgpath, gpgurl = cls._gpg_locations(epel_release)
         epel_gpgpath, epel_gpgurl = cls._epel_gpg_locations()
+        extras_gpgpath, extras_gpgurl = cls._extras_gpg_locations(epel_release)
 
         if config.local_mirror:
             appstream_url = f"baseurl={config.local_mirror}"
-            baseos_url = crb_url = epel_url = None
+            baseos_url = extras_url = crb_url = epel_url = None
         elif config.mirror:
             appstream_url = f"baseurl={config.mirror}/centos-stream/$stream/AppStream/$basearch/os"
             baseos_url = f"baseurl={config.mirror}/centos-stream/$stream/BaseOS/$basearch/os"
+            extras_url = f"baseurl={config.mirror}/centos-stream/SIGS/$stream/extras/$basearch/extras-common"
             crb_url = f"baseurl={config.mirror}/centos-stream/$stream/CRB/$basearch/os"
             epel_url = f"baseurl={config.mirror}/epel/$stream/Everything/$basearch"
         else:
             appstream_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http"
             baseos_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http"
+            extras_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http"
             crb_url = "metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http"
             epel_url = "mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=epel-$releasever&arch=$basearch&protocol=https,http"
 
         repos = [Repo("appstream", appstream_url, gpgpath, gpgurl)]
         if baseos_url is not None:
             repos += [Repo("baseos", baseos_url, gpgpath, gpgurl)]
+        if extras_url is not None:
+            repos += [Repo("extras", extras_url, extras_gpgpath, extras_gpgurl)]
         if crb_url is not None:
             repos += [Repo("crb", crb_url, gpgpath, gpgurl)]
         if epel_url is not None:
index fba7c4700637c4d28059cde671a8cf6fea8dcad8..d4181303867e510a27602ff160993b5746406e00 100644 (file)
@@ -14,6 +14,14 @@ class RockyInstaller(CentosInstaller):
              f"https://download.rockylinux.org/pub/rocky/RPM-GPG-KEY-{keyname}"
         )
 
+    @staticmethod
+    def _extras_gpg_locations(epel_release: int) -> tuple[Path, str]:
+        keyname = "Rocky-$releasever" if epel_release >= 9 else "rockyofficial"
+        return (
+             Path(f"/etc/pki/rpm-gpg/RPM-GPG-KEY-{keyname}"),
+             f"https://download.rockylinux.org/pub/rocky/RPM-GPG-KEY-{keyname}"
+        )
+
     @classmethod
     def _mirror_directory(cls) -> str:
         return "rocky"