public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Adam Williamson <awilliam@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/fedora-repos] f45: Add a check that RPM can import the same keys as GPG
Date: Mon, 10 Aug 2026 09:41:24 GMT	[thread overview]
Message-ID: <178635488467.1.7384949081076266642.rpms-fedora-repos-f2cbb4bb926d@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/fedora-repos
            Branch : f45
            Commit : f2cbb4bb926df42720899375b18652192f0d6f65
            Author : Adam Williamson <awilliam@redhat.com>
            Date   : 2022-08-16T22:47:08-04:00
            Stats  : +5/-2 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedora-repos/c/f2cbb4bb926df42720899375b18652192f0d6f65?branch=f45

            Log:
            Add a check that RPM can import the same keys as GPG

`rpm --import` seems to be stricter than `gpg --import` on white
space issues - gpg imported the problematic Fedora 39 key file
that was just fixed fine, but rpm refused it. So let's check
that `rpm --import` works on all the keys we check `gpg --import`
on too.

Signed-off-by: Adam Williamson <awilliam@redhat.com>

---
diff --git a/fedora-repos.spec b/fedora-repos.spec
index 4a2c669..19e0312 100644
--- a/fedora-repos.spec
+++ b/fedora-repos.spec
@@ -17,7 +17,7 @@ Requires:       fedora-repos-rawhide = %{version}-%{release}
 Requires:       fedora-gpg-keys >= %{version}-%{release}
 BuildArch:      noarch
 # Required by %%check
-BuildRequires:  gnupg sed
+BuildRequires:  gnupg sed rpm
 
 Source1:        archmap
 Source2:        fedora.repo
@@ -357,14 +357,17 @@ for repo in $RPM_BUILD_ROOT/etc/yum.repos.d/fedora-rawhide*.repo; do
     done <<< "$gpg_lines"
 done
 
-# Check arch keys exists on supported architectures
+# Check arch keys exists on supported architectures, and RPM considers
+# them valid
 TMPRING=$(mktemp)
+DBPATH=$(mktemp -d)
 for VER in %{version} %{rawhide_release} ${rawhide_next}; do
   echo -n > "$TMPRING"
   for ARCH in $(sed -ne "s/^fedora-${VER}-primary://p" %{_sourcedir}/archmap)
   do
     gpg --no-default-keyring --keyring="$TMPRING" \
       --import $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-fedora-$VER-$ARCH
+    rpm --dbpath "$DBPATH" --import $RPM_BUILD_ROOT%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-fedora-$VER-$ARCH --test
   done
   # Ensure some arch key was imported
   gpg --no-default-keyring --keyring="$TMPRING" --list-keys | grep -A 2 '^pub\s'

                 reply	other threads:[~2026-08-10  9:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178635488467.1.7384949081076266642.rpms-fedora-repos-f2cbb4bb926d@fedoraproject.org \
    --to=awilliam@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox