public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Fix incomplete header on plain src.rpm build modes regression
@ 2026-11-23 9:35 Michal Domonkos
0 siblings, 0 replies; only message in thread
From: Michal Domonkos @ 2026-11-23 9:35 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rpm
Branch : pmatilai-v6
Commit : 48f40ad3d483bc0fc14946cffe14b7441e39782a
Author : Michal Domonkos <mdomonko@redhat.com>
Date : 2024-05-27T13:13:54+02:00
Stats : +172/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpm/c/48f40ad3d483bc0fc14946cffe14b7441e39782a?branch=pmatilai-v6
Log:
Fix incomplete header on plain src.rpm build modes regression
Like promised in the previous commits, we're back with yet another
regression hotfix, this time found while building random packages in
Koji with the new rpm 4.20 stack. Are we Alpha quality yet? Let's
see...
---
diff --git a/0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch b/0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
new file mode 100644
index 0000000..15afa14
--- /dev/null
+++ b/0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
@@ -0,0 +1,171 @@
+From e464af747b1ad97b9a088cc2045263864f283566 Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Mon, 27 May 2024 13:53:32 +0300
+Subject: [PATCH] Fix incomplete header on plain src.rpm build modes regression
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since 9165963de8bb5d5ad0a24ea4656d6d04d733f6bc, the main header wasn't
+getting properly filled on plain src.rpm build modes like -bs. So a lot
+of things was missing, but spotted in particular because %packager
+wasn't getting set as per macros in Koji. Fix by letting rpm finalize
+the spec after parse when no dynamic spec parts are to be executed.
+
+Add a bunch of tests around this - we can't possibly test every single
+build scenario but this should cover at least the most common ones
+pretty well.
+
+Reported-by: Miro Hrončok <miro@hroncok.cz>
+---
+ tests/rpmbuild.at | 54 ++++++++++++++++++++++++++++++++++++++++++++++-
+ tools/rpmbuild.c | 14 ++++++------
+ 2 files changed, 61 insertions(+), 7 deletions(-)
+
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index a665a6bce..2243afcf4 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -26,6 +26,7 @@ RPMDB_INIT
+ RPMTEST_CHECK([
+
+ run rpmbuild \
++ --define "packager Iam" \
+ -ba ${RPMDATA}/SPECS/hello.spec
+ ],
+ [0],
+@@ -42,6 +43,38 @@ runroot rpm -qp --qf "%{license}\n" /build/RPMS/*/hello-1.0-1.*.rpm
+ GPL
+ ],
+ [])
++
++RPMTEST_CHECK([
++runroot rpm -qp --qf "%{packager}\n" /build/SRPMS/hello-1.0-1.src.rpm
++runroot rpm -qp --qf "%{packager}\n" /build/RPMS/*/hello-1.0-1.*.rpm
++],
++[0],
++[Iam
++Iam
++],
++[])
++RPMTEST_CLEANUP
++
++AT_SETUP([rpmbuild -bs spec])
++AT_KEYWORDS([build])
++RPMDB_INIT
++
++RPMTEST_CHECK([
++runroot rpmbuild -bs \
++ --define "packager Iam" \
++ ${RPMDATA}/SPECS/hello.spec
++],
++[0],
++[ignore],
++[ignore])
++
++RPMTEST_CHECK([
++runroot rpm -q --qf "%{packager}\n" /build/SRPMS/hello-1.0-1.src.rpm
++],
++[0],
++[Iam
++],
++[])
+ RPMTEST_CLEANUP
+
+ AT_SETUP([rpmbuild -b buildsystem])
+@@ -471,11 +504,20 @@ RPMDB_INIT
+ RPMTEST_CHECK([
+
+ run rpmbuild \
++ --define "packager Iam" \
+ --rebuild ${RPMDATA}/SRPMS/hello-1.0-1.src.rpm
+ ],
+ [0],
+ [ignore],
+ [ignore])
++
++RPMTEST_CHECK([
++runroot rpm -qp --qf "%{packager}\n" /build/RPMS/*/hello-1.0-1.*.rpm
++],
++[0],
++[Iam
++],
++[])
+ RPMTEST_CLEANUP
+
+ AT_SETUP([rpmbuild --short-circuit -bl])
+@@ -512,7 +554,9 @@ AT_KEYWORDS([build])
+ RPMDB_INIT
+ RPMTEST_CHECK([
+
+-runroot rpmbuild --quiet -ts /data/SOURCES/hello-2.0.tar.gz
++runroot rpmbuild --quiet \
++ --define "packager Iam" \
++ -ts /data/SOURCES/hello-2.0.tar.gz
+ runroot rpm -qpl /build/SRPMS/hello-2.0-1.src.rpm
+ ],
+ [0],
+@@ -520,6 +564,14 @@ runroot rpm -qpl /build/SRPMS/hello-2.0-1.src.rpm
+ hello.spec
+ ],
+ [])
++
++RPMTEST_CHECK([
++runroot rpm -q --qf "%{packager}\n" /build/SRPMS/hello-2.0-1.src.rpm
++],
++[0],
++[Iam
++],
++[])
+ RPMTEST_CLEANUP
+
+ # weird filename survival test
+diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
+index dd36e24d8..6e6d2cfe4 100644
+--- a/tools/rpmbuild.c
++++ b/tools/rpmbuild.c
+@@ -79,6 +79,14 @@ static void buildArgCallback( poptContext con,
+ BTA_t rba = &rpmBTArgs;
+
+ switch (opt->val) {
++ case POPT_BS:
++ case POPT_RS:
++ case POPT_TS:
++ case POPT_BR:
++ case POPT_RR:
++ case POPT_TR:
++ /* If only building src.rpm, there are no dynamic parts to include */
++ spec_flags &= ~RPMSPEC_NOFINALIZE;
+ case POPT_REBUILD:
+ case POPT_RECOMPILE:
+ case POPT_BA:
+@@ -89,8 +97,6 @@ static void buildArgCallback( poptContext con,
+ case POPT_BI:
+ case POPT_BL:
+ case POPT_BP:
+- case POPT_BS:
+- case POPT_BR:
+ case POPT_RA:
+ /* case POPT_RB: same value as POPT_REBUILD */
+ case POPT_RC:
+@@ -99,8 +105,6 @@ static void buildArgCallback( poptContext con,
+ case POPT_RI:
+ case POPT_RL:
+ case POPT_RP:
+- case POPT_RS:
+- case POPT_RR:
+ case POPT_TA:
+ case POPT_TB:
+ case POPT_TC:
+@@ -109,8 +113,6 @@ static void buildArgCallback( poptContext con,
+ case POPT_TI:
+ case POPT_TL:
+ case POPT_TP:
+- case POPT_TS:
+- case POPT_TR:
+ if (opt->val == POPT_BS || opt->val == POPT_TS)
+ noDeps = 1;
+ if (buildMode == '\0' && buildChar == '\0') {
+--
+2.45.1
+
diff --git a/rpm.spec b/rpm.spec
index 693291f..756345b 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -152,6 +152,7 @@ rpm-4.19.91-weak-user-group.patch
0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
0002-Drop-an-accidentally-added-duplicated-test.patch
0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
+0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
# These are not yet upstream
rpm-4.7.1-geode-i686.patch
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-23 9:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 9:35 [rpms/rpm] pmatilai-v6: Fix incomplete header on plain src.rpm build modes regression Michal Domonkos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox