From: Daan De Meyer Date: Thu, 16 Jan 2025 14:31:10 +0000 (+0100) Subject: Look for the CentOS Stream official GPG in /etc/pki/rpm-gpg as well X-Git-Tag: v25~46^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aafe91752a55779ba7034398006e51643d720ced;p=thirdparty%2Fmkosi.git Look for the CentOS Stream official GPG in /etc/pki/rpm-gpg as well Turns out the key names in /etc/pki/rpm-gpg are slightly different so let's update the logic to search properly for both. --- diff --git a/mkosi/distributions/centos.py b/mkosi/distributions/centos.py index 6ef2a366f..3cbbaabfc 100644 --- a/mkosi/distributions/centos.py +++ b/mkosi/distributions/centos.py @@ -98,16 +98,36 @@ class Installer(DistributionInstaller): @staticmethod def gpgurls(context: Context) -> tuple[str, ...]: + # First, start with the names of the appropriate keys in /etc/pki/rpm-gpg. + + if context.config.release == "9": + rel = "RPM-GPG-KEY-centosofficial" + else: + rel = "RPM-GPG-KEY-centosofficial-SHA256" + + one = find_rpm_gpgkey(context, rel, required=False) + + # Next, follow up with the names of the appropriate keys in /usr/share/distribution-gpg-keys. + if context.config.release == "9": rel = "RPM-GPG-KEY-CentOS-Official" else: rel = "RPM-GPG-KEY-CentOS-Official-SHA256" - return tuple( - find_rpm_gpgkey(context, key, f"https://www.centos.org/keys/{key}") - for key in (rel, "RPM-GPG-KEY-CentOS-SIG-Extras") + # The key in /usr/share/distribution-gpg-keys is only required if we didn't find one in + # /etc/pki/rpm-gpg. + two = find_rpm_gpgkey(context, rel, f"https://www.centos.org/keys/{rel}", required=bool(one)) + + # Finally, look up the key for the SIG-Extras repository. + + sig = find_rpm_gpgkey( + context, + "RPM-GPG-KEY-CentOS-SIG-Extras", + "https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Extras", ) + return tuple(key for key in (one, two, sig) if key is not None) + @classmethod def repository_variants(cls, context: Context, repo: str) -> Iterable[RpmRepository]: if context.config.local_mirror: