public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Rebase to rpm 6.0 beta1
Date: Mon, 23 Nov 2026 09:36:00 GMT	[thread overview]
Message-ID: <179542656098.1.513700712124925053.rpms-rpm-c67b96ec465e@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : c67b96ec465e9f02104cf90f5ace2386ff20a56f
            Author : Panu Matilainen <pmatilai@redhat.com>
            Date   : 2025-07-09T11:20:10+02:00
            Stats  : +41/-271 in 7 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/c67b96ec465e9f02104cf90f5ace2386ff20a56f?branch=pmatilai-v6

            Log:
            Rebase to rpm 6.0 beta1

Upstream changed the default to v6, revert back to v4 for Fedora. That's
changing that is a system-wide change of it's own, some day.

Use a patch instead of sed-hacks for both the verify level and package
format change, easier to track and errors cannot go unnoticed.

Related: #2360107

---
diff --git a/.gitignore b/.gitignore
index ef48122..903e242 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,3 +70,4 @@
 /rpm-4.20.0.tar.bz2
 /rpm-4.20.1.tar.bz2
 /rpm-5.99.90.tar.bz2
+/rpm-5.99.91.tar.bz2

diff --git a/0001-Fix-a-refactoring-regression-in-rich-dep-and-rpmdb-s.patch b/0001-Fix-a-refactoring-regression-in-rich-dep-and-rpmdb-s.patch
deleted file mode 100644
index 8fdbda2..0000000
--- a/0001-Fix-a-refactoring-regression-in-rich-dep-and-rpmdb-s.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From a333eaa3f0fbce0c77cea23015144e13d9c039e2 Mon Sep 17 00:00:00 2001
-Message-ID: <a333eaa3f0fbce0c77cea23015144e13d9c039e2.1747030627.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Wed, 23 Apr 2025 13:03:30 +0300
-Subject: [PATCH] Fix a refactoring regression in rich dep and rpmdb set
- calculations
-
-Commit 52f311e224254d7cb28bf2ced22db7b50e1a2653 failed to take into
-account that std::set_difference() and std::set_intersection() require
-both data sets to be sorted, whereas the old manual implementation only
-required the second set to be sorted.
-
-Add a minimal testcase for the WITH rich dep case from the original
-report. Technically the same issue could occur with WITHOUT rich
-dependencies and rpmdb lookups through dbiFindMatches() but I don't
-reproducers for those so just fixing the code for the "obvious" error.
-
-I'm not 100% confident this addresses all such assumptions in the
-codebase. dbiIndexSet should really use a data structure that doesn't
-require manual sorting like this, but then that's a much bigger change
-as the rpmdb code is currently accessing the set members via an index...
-
-Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2360342
----
- lib/backend/dbiset.cc |  4 ++++
- lib/backend/dbiset.hh |  6 ++++--
- tests/rpmdeps.at      | 10 ++++++++--
- 3 files changed, 16 insertions(+), 4 deletions(-)
-
-diff --git a/lib/backend/dbiset.cc b/lib/backend/dbiset.cc
-index 14b6d7857..e29dfd377 100644
---- a/lib/backend/dbiset.cc
-+++ b/lib/backend/dbiset.cc
-@@ -101,6 +101,8 @@ int dbiIndexSetPruneSet(dbiIndexSet set, dbiIndexSet oset, int sorted)
-     if (set->recs.empty() || oset == NULL || oset->recs.empty())
- 	return 1;
- 
-+    if (set->recs.size() > 1 && !sorted)
-+	dbiIndexSetSort(set);
-     if (oset->recs.size() > 1 && !sorted)
- 	dbiIndexSetSort(oset);
- 
-@@ -120,6 +122,8 @@ int dbiIndexSetFilterSet(dbiIndexSet set, dbiIndexSet oset, int sorted)
- 	return num ? 0 : 1;
-     }
- 
-+    if (set->recs.size() > 1 && !sorted)
-+	dbiIndexSetSort(set);
-     if (oset->recs.size() > 1 && !sorted)
- 	dbiIndexSetSort(oset);
- 
-diff --git a/lib/backend/dbiset.hh b/lib/backend/dbiset.hh
-index fdb28e96d..10d584545 100644
---- a/lib/backend/dbiset.hh
-+++ b/lib/backend/dbiset.hh
-@@ -51,9 +51,10 @@ int dbiIndexSetAppendOne(dbiIndexSet set, unsigned int hdrNum,
- 
- /**
-  * Remove an index set from another.
-+ * The sets are sorted as a side-effect if sorted is 0.
-  * @param set          set of index database items
-  * @param oset         set of entries that should be removed
-- * @param sorted       oset is already sorted?
-+ * @param sorted       are set and oset already sorted?
-  * @return             0 success, 1 failure (no items found)
-  */
- RPM_GNUC_INTERNAL
-@@ -61,9 +62,10 @@ int dbiIndexSetPruneSet(dbiIndexSet set, dbiIndexSet oset, int sorted);
- 
- /**
-  * Filter (intersect) an index set with another.
-+ * The sets are sorted as a side-effect if sorted is 0.
-  * @param set          set of index database items
-  * @param oset         set of entries that should be intersected
-- * @param sorted       oset is already sorted?
-+ * @param sorted       are set and oset already sorted?
-  * @return             0 success, 1 failure (no items removed)
-  */
- RPM_GNUC_INTERNAL
-diff --git a/tests/rpmdeps.at b/tests/rpmdeps.at
-index 4aca7168e..469ea04db 100644
---- a/tests/rpmdeps.at
-+++ b/tests/rpmdeps.at
-@@ -327,17 +327,23 @@ AT_KEYWORDS([install, boolean])
- runroot rpmbuild --quiet -bb \
- 	--define "pkg one" \
- 	--define "reqs (deptest-two with flavor = desktop)" \
-+	--define "provs feat = 4.0" \
- 	  /data/SPECS/deptest.spec
- 
- runroot rpmbuild --quiet -bb \
- 	--define "pkg two" \
--	--define "provs flavor = desktop" \
-+	--define "provs flavor = desktop feat = 1.5" \
-+	  /data/SPECS/deptest.spec
-+
-+runroot rpmbuild --quiet -bb \
-+	--define "pkg three" \
-+	--define "reqs (feat >= 1.0 with feat < 3.0)" \
- 	  /data/SPECS/deptest.spec
- 
- # satisfied WITH require in transaction
- RPMTEST_CHECK([
- RPMDB_RESET
--runroot rpm -U /build/RPMS/noarch/deptest-one-1.0-1.noarch.rpm /build/RPMS/noarch/deptest-two-1.0-1.noarch.rpm
-+runroot rpm -U /build/RPMS/noarch/deptest-two-1.0-1.noarch.rpm /build/RPMS/noarch/deptest-three-1.0-1.noarch.rpm /build/RPMS/noarch/deptest-one-1.0-1.noarch.rpm
- ],
- [0],
- [],
--- 
-2.49.0
-

diff --git a/0001-Fix-a-regression-when-calling-rpmReadPackageFile-wit.patch b/0001-Fix-a-regression-when-calling-rpmReadPackageFile-wit.patch
deleted file mode 100644
index aead7a0..0000000
--- a/0001-Fix-a-regression-when-calling-rpmReadPackageFile-wit.patch
+++ /dev/null
@@ -1,151 +0,0 @@
-From 492ff071da8b3a6b344122206834b68dc49746f3 Mon Sep 17 00:00:00 2001
-Message-ID: <492ff071da8b3a6b344122206834b68dc49746f3.1747030462.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Wed, 30 Apr 2025 11:42:17 +0300
-Subject: [PATCH] Fix a regression when calling rpmReadPackageFile() with NULL
- ts
-
-Commit 09510e413dbbdecfa6d65406a31517c79dd6c773 introduced unconditional
-dereferencing of the keyring during verification, and so segfaults on
-NULL keyring. That can't happen within rpm itself, so we need a new
-test program to trigger it: call rpmReadPackageFile() with NULL ts.
-
-Start a new test group of API tests, we'll need to do more of these.
-I wasted an hour or two looking for a way to reproduce this by rpm or
-the python bindings when writing this tiny test-program took all of
-five minutes.
-
-Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2362996
-
-(tests/CMakeLists.txt is slightly modified from upstream to get it to
-apply)
-
----
- rpmio/rpmkeyring.cc   | 32 +++++++++++++++++---------------
- tests/CMakeLists.txt  |  5 +++--
- tests/readpkgnullts.c | 18 ++++++++++++++++++
- tests/rpmapi.at       | 13 +++++++++++++
- 4 files changed, 51 insertions(+), 17 deletions(-)
- create mode 100644 tests/readpkgnullts.c
- create mode 100644 tests/rpmapi.at
-
-diff --git a/rpmio/rpmkeyring.cc b/rpmio/rpmkeyring.cc
-index 7edbf83a7..4853d045c 100644
---- a/rpmio/rpmkeyring.cc
-+++ b/rpmio/rpmkeyring.cc
-@@ -429,27 +429,29 @@ rpmRC rpmKeyringVerifySig2(rpmKeyring keyring, pgpDigParams sig, DIGEST_CTX ctx,
-     rpmPubkey key = NULL;
- 
-     if (sig && ctx) {
--	rdlock lock(keyring->mutex);
--	auto keyid = key2str(pgpDigParamsSignID(sig));
- 	std::vector<std::pair<int, std::string>> results = {};
-+	if (keyring) {
-+	    auto keyid = key2str(pgpDigParamsSignID(sig));
-+	    rdlock lock(keyring->mutex);
- 
--	/* Look for verifying key */
--	auto range = keyring->keys.equal_range(keyid);
-+	    /* Look for verifying key */
-+	    auto range = keyring->keys.equal_range(keyid);
- 
--	for (auto it = range.first; it != range.second; ++it) {
--	    key = it->second;
-+	    for (auto it = range.first; it != range.second; ++it) {
-+		key = it->second;
- 
--	    /* Do the parameters match the signature? */
--	    if (pgpDigParamsAlgo(sig, PGPVAL_PUBKEYALGO)
--		!= pgpDigParamsAlgo(key->pgpkey, PGPVAL_PUBKEYALGO))
--	    {
--		continue;
--	    }
-+		/* Do the parameters match the signature? */
-+		if (pgpDigParamsAlgo(sig, PGPVAL_PUBKEYALGO)
-+		    != pgpDigParamsAlgo(key->pgpkey, PGPVAL_PUBKEYALGO))
-+		{
-+		    continue;
-+		}
- 
--	    rc = pubKeyVerify(key, sig, ctx, results);
-+		rc = pubKeyVerify(key, sig, ctx, results);
- 
--	    if (rc == RPMRC_OK)
--		break;
-+		if (rc == RPMRC_OK)
-+		    break;
-+	    }
- 	}
- 
- 	/* No key, sanity check signature*/
-diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
-index 3c0066f46..bef9c8bd2 100644
---- a/tests/CMakeLists.txt
-+++ b/tests/CMakeLists.txt
-@@ -28,6 +28,7 @@ set(TESTSUITE_AT
- 	rpmgeneral.at
- 	rpmvercmp.at
- 	rpmmacro.at
-+	rpmapi.at
- 	rpmdevel.at
- 	rpmpython.at
- 	rpmdepmatch.at
-@@ -61,10 +62,10 @@ foreach(at ${TESTSUITE_AT})
- 	FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/rpmtests.at "m4_include([${at}])\n")
- endforeach()
- 
--set(TESTPROGS rpmpgpcheck rpmpgppubkeyfingerprint)
-+set(TESTPROGS rpmpgpcheck rpmpgppubkeyfingerprint readpkgnullts)
- foreach(prg ${TESTPROGS})
- 	add_executable(${prg} EXCLUDE_FROM_ALL ${prg}.c)
--	target_link_libraries(${prg} PRIVATE librpmio)
-+	target_link_libraries(${prg} PRIVATE librpm)
- endforeach()
- string(REPLACE ";" " " TESTPROG_NAMES "${TESTPROGS}")
- 
-diff --git a/tests/readpkgnullts.c b/tests/readpkgnullts.c
-new file mode 100644
-index 000000000..37c464eda
---- /dev/null
-+++ b/tests/readpkgnullts.c
-@@ -0,0 +1,18 @@
-+#include <stdio.h>
-+#include <rpm/rpmlib.h>
-+
-+int main(int argc, char *argv[])
-+{
-+    Header h = NULL;
-+    FD_t fd = Fopen(argv[1], "r");
-+    int rc = rpmReadPackageFile(NULL, fd, argv[1], &h);
-+    if (h != NULL) {
-+	char *nevra = headerGetAsString(h, RPMTAG_NEVRA);
-+	printf("%s\n", nevra);
-+	free(nevra);
-+    }
-+
-+    Fclose(fd);
-+    headerFree(h);
-+    return rc;
-+}
-diff --git a/tests/rpmapi.at b/tests/rpmapi.at
-new file mode 100644
-index 000000000..d8fe1c840
---- /dev/null
-+++ b/tests/rpmapi.at
-@@ -0,0 +1,13 @@
-+AT_BANNER([RPM API tests])
-+
-+RPMTEST_SETUP([[rpmReadPackage() with NULL ts]])
-+AT_KEYWORDS([[api signature]])
-+RPMTEST_CHECK([[
-+readpkgnullts /data/RPMS/hello-2.0-1.x86_64-signed.rpm
-+]],
-+[4],
-+[hello-2.0-1.x86_64
-+],
-+[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header OpenPGP V4 RSA/SHA256 signature, key ID 4344591e1964c5fc: NOKEY
-+])
-+RPMTEST_CLEANUP
--- 
-2.49.0
-

diff --git a/rpm-6.0-rpmformat.patch b/rpm-6.0-rpmformat.patch
new file mode 100644
index 0000000..f5f4700
--- /dev/null
+++ b/rpm-6.0-rpmformat.patch
@@ -0,0 +1,12 @@
+diff -up rpm-5.99.91/macros.in.rpmformat rpm-5.99.91/macros.in
+--- rpm-5.99.91/macros.in.rpmformat	2025-07-02 10:35:25.595849666 +0300
++++ rpm-5.99.91/macros.in	2025-07-02 10:35:38.956370457 +0300
+@@ -258,7 +258,7 @@ Supplements:   (%{name} = %{version}-%{r
+ %_rpmfilename		%{_build_name_fmt}
+ 
+ #	Which rpm format go generate (4 or 6)
+-%_rpmformat 6
++%_rpmformat 4
+ 
+ #	The directory where sources/patches from a source package will be
+ #	installed. This is also where sources/patches are found when building.

diff --git a/rpm-6.0-vfylevel.patch b/rpm-6.0-vfylevel.patch
new file mode 100644
index 0000000..3c44126
--- /dev/null
+++ b/rpm-6.0-vfylevel.patch
@@ -0,0 +1,12 @@
+diff -up rpm-5.99.91/macros.in.rpmformat rpm-5.99.91/macros.in
+--- rpm-5.99.91/macros.in.rpmformat	2025-07-02 10:35:25.595849666 +0300
++++ rpm-5.99.91/macros.in	2025-07-02 10:35:38.956370457 +0300
+@@ -676,7 +676,7 @@ Supplements:   (%{name} = %{version}-%{r
+ # signature	require valid signature(s)
+ # digest	require valid digest(s)
+ # none		traditional rpm behavior, nothing required
+-%_pkgverify_level all
++%_pkgverify_level digest
+ 
+ # Disabler flags for package verification (similar to vsflags)
+ # Set to 0x0 for full compatibility with v4 packages.

diff --git a/rpm.spec b/rpm.spec
index 83bfc6e..36e0e5a 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -22,9 +22,9 @@
 
 %define rpmhome /usr/lib/rpm
 
-%global rpmver 5.99.90
+%global rpmver 5.99.91
 #global snapver rc1
-%global baserelease 6
+%global baserelease 1
 %global sover 10
 
 %global srcver %{rpmver}%{?snapver:-%{snapver}}
@@ -113,6 +113,10 @@ rpm-4.9.90-no-man-dirs.patch
 
 # Use systemd-sysusers due to https://github.com/shadow-maint/shadow/issues/940
 rpm-4.20-sysusers.patch
+# Back out of enforcing signature checking until the infra is updated
+rpm-6.0-vfylevel.patch
+# Back out to v4 package format by default until the infra is updated
+rpm-6.0-rpmformat.patch
 
 # Temporarily disable the deprecation warning for
 # %%clamp_mtime_to_source_date_epoch, details here:
@@ -120,8 +124,6 @@ rpm-4.20-sysusers.patch
 0001-Revert-Add-a-deprecation-warning-for-clamp_mtime_to_.patch
 
 # Patches already upstream:
-0001-Fix-a-refactoring-regression-in-rich-dep-and-rpmdb-s.patch
-0001-Fix-a-regression-when-calling-rpmReadPackageFile-wit.patch
 
 # These are not yet upstream
 rpm-4.7.1-geode-i686.patch
@@ -346,9 +348,6 @@ change.
 %prep
 %autosetup -n rpm-%{srcver} -p1
 
-# back out of enforcing signature checking until the build tooling works with it
-sed -i -e "s:%%_pkgverify_level all:%%_pkgverify_level digest:g" macros.in
-
 %build
 %set_build_flags
 
@@ -460,6 +459,10 @@ fi
 %{_mandir}/man5/rpm-config.5*
 %{_mandir}/man5/rpm-macrofile.5*
 %{_mandir}/man5/rpm-rpmrc.5*
+%{_mandir}/man7/rpm-lua.7*
+%{_mandir}/man7/rpm-macros.7*
+%{_mandir}/man7/rpm-payloadflags.7*
+%{_mandir}/man7/rpm-queryformat.7*
 %{_mandir}/man8/rpm.8*
 %{_mandir}/man8/rpmdb.8*
 %{_mandir}/man8/rpmkeys.8*
@@ -570,6 +573,7 @@ fi
 %{_mandir}/man1/rpmspec.1*
 %{_mandir}/man1/rpmlua.1*
 %{_mandir}/man1/rpm-setup-autosign.1*
+%{_mandir}/man5/rpmbuild-config.5.*
 
 %{rpmhome}/brp-*
 %{rpmhome}/check-*
@@ -617,6 +621,10 @@ fi
 %doc %{_defaultdocdir}/rpm/API/
 
 %changelog
+* Wed Jul 02 2025 Panu Matilainen <pmatilai@redhat.com> - 5.99.91-1
+- Rebase to 6.0 beta1
+- Revert to v4 package format by default for now (upstream switched to v6)
+
 * Mon Jun 02 2025 Python Maint <python-maint@redhat.com> - 5.99.90-6
 - Rebuilt for Python 3.14
 

diff --git a/sources b/sources
index d544d17..9cf0aa8 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (rpm-5.99.90.tar.bz2) = b18862d60c3dee71867e9ef851903ebc73919cb1fbebb20d46cd8db9bc80985cb0f7a45bdbe2a7d33178b21cd2cdd125cb9f72510860c0f82c24bbc285fa9a84
+SHA512 (rpm-5.99.91.tar.bz2) = fef131241c9a0443201fc04554b5afa8fa4dd15d808c1ffca802429b7e836c97c2264589c1614203fc747b07cbf1e36b1fce5318c5208f31649617b0f770bd91

                 reply	other threads:[~2026-11-23  9:36 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=179542656098.1.513700712124925053.rpms-rpm-c67b96ec465e@fedoraproject.org \
    --to=pmatilai@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