public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Fix unwanted rpmspec output when there are dynamic sections
Date: Mon, 23 Nov 2026 09:35:45 GMT	[thread overview]
Message-ID: <179542654511.1.10430915303989723157.rpms-rpm-0c641f9f9790@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : 0c641f9f97902a15ad76578a004c826457b57b30
            Author : Benjamin A. Beasley <code@musicinmybrain.net>
            Date   : 2024-12-12T11:05:53-05:00
            Stats  : +70/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/0c641f9f97902a15ad76578a004c826457b57b30?branch=pmatilai-v6

            Log:
            Fix unwanted rpmspec output when there are dynamic sections

Backports https://github.com/rpm-software-management/rpm/pull/3414.

---
diff --git a/0001-Silence-extra-output-on-rpmspec-query-on-Buildsystem.patch b/0001-Silence-extra-output-on-rpmspec-query-on-Buildsystem.patch
new file mode 100644
index 0000000..93422ec
--- /dev/null
+++ b/0001-Silence-extra-output-on-rpmspec-query-on-Buildsystem.patch
@@ -0,0 +1,61 @@
+From 71a6aa9349d5846115fa09bdf4506328802ffa7f Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Wed, 30 Oct 2024 09:10:14 +0200
+Subject: [PATCH] Silence extra output on rpmspec query on Buildsystem specs
+
+Dynamic spec parsing emits "Reading <path>" messages to make it clear
+something out of the ordinary is going on, but this is undesireable
+on rpmspec queries. Luckily there's a trivial solution: rpmbuild where
+you want these messages runs in verbose mode by default whereas rpmspec
+does not. So just moving the message to INFO level does exactly the
+right thing in both the above cases. Add a test to go.
+
+Fies: #3413
+---
+ build/parseSpec.c | 2 +-
+ tests/rpmbuild.at | 9 ++++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/build/parseSpec.c b/build/parseSpec.c
+index df08575ec..0d4605366 100644
+--- a/build/parseSpec.c
++++ b/build/parseSpec.c
+@@ -1426,7 +1426,7 @@ static rpmRC parseSpecParts(rpmSpec spec, const char *pattern,
+     /* rpmGlob returns files sorted */
+     if (rpmGlob(pattern, &argc, &argv) == 0) {
+ 	for (int i = 0; i < argc; i++) {
+-	    rpmlog(RPMLOG_NOTICE, "Reading %s\n", argv[i]);
++	    rpmlog(RPMLOG_INFO, "Reading %s\n", argv[i]);
+ 	    pushOFI(spec, argv[i]);
+ 	    snprintf(spec->fileStack->readBuf, spec->fileStack->readBufLen,
+ 		     "# Spec part read from %s\n\n", argv[i]);
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index 6c86e6eb5..3fa90bb9b 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -78,7 +78,7 @@ runroot rpm -q --qf "%{packager}\n" /build/SRPMS/hello-1.0-1.src.rpm
+ RPMTEST_CLEANUP
+ 
+ AT_SETUP([rpmbuild -b buildsystem])
+-AT_KEYWORDS([build])
++AT_KEYWORDS([build buildsystem])
+ RPMDB_INIT
+ 
+ cp "${RPMTEST}/data/macros.buildsystem" "${RPMTEST}/${RPM_CONFIGDIR_PATH}/macros.d/"
+@@ -185,6 +185,13 @@ runroot rpmbuild -bb \
+ [error: line 11: Required parametric macro %buildsystem_autotools_build not defined for buildsystem autotools
+ ])
+ 
++RPMTEST_CHECK([
++runroot rpmspec -q --qf "%{nvr}\n" /data/SPECS/amhello.spec
++],
++[0],
++[amhello-1.0-1
++],
++[])
+ RPMTEST_CLEANUP
+ 
+ AT_SETUP([rpmbuild -b steps])
+-- 
+2.47.1
+

diff --git a/rpm.spec b/rpm.spec
index 9857821..e3cff4f 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -28,7 +28,7 @@
 
 %global rpmver 4.20.0
 #global snapver rc1
-%global baserelease 2
+%global baserelease 3
 %global sover 10
 
 %global srcver %{rpmver}%{?snapver:-%{snapver}}
@@ -134,6 +134,11 @@ rpm-4.19.91-weak-user-group.patch
 0001-Revert-Add-a-deprecation-warning-for-clamp_mtime_to_.patch
 
 # Patches already upstream:
+# Silence extra output on rpmspeq query on Buildsystem specs
+# https://github.com/rpm-software-management/rpm/pull/3414
+# Fixes: Regression: addtional output in rpmspec with -q
+# https://github.com/rpm-software-management/rpm/issues/3413
+0001-Silence-extra-output-on-rpmspec-query-on-Buildsystem.patch
 
 # These are not yet upstream
 rpm-4.7.1-geode-i686.patch
@@ -619,6 +624,9 @@ fi
 %doc %{_defaultdocdir}/rpm/API/
 
 %changelog
+* Thu Dec 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 4.20.0-3
+- Fix unwanted rpmspec output when there are dynamic sections
+
 * Tue Dec 10 2024 Michal Domonkos <mdomonko@redhat.com> - 4.20.0-2
 - Drop build option for legacy OpenPGP parser (#2239780)
 - Fix Python examples directory ownership (#2279750)

                 reply	other threads:[~2026-11-23  9:35 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=179542654511.1.10430915303989723157.rpms-rpm-0c641f9f9790@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --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