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: Silence harmless but bogus error message on noarch packages (#1482144)
Date: Mon, 23 Nov 2026 09:31:28 GMT	[thread overview]
Message-ID: <179542628814.1.5008499891209542671.rpms-rpm-6f54bf086ac3@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 6f54bf086ac3fdf39ac21c5e2090fcb8e4234b3d
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2017-08-18T16:17:46+03:00
Stats  : +99/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/6f54bf086ac3fdf39ac21c5e2090fcb8e4234b3d?branch=pmatilai-v6

Log:
Silence harmless but bogus error message on noarch packages (#1482144)

---
diff --git a/rpm-4.13.90-silent-lookup.patch b/rpm-4.13.90-silent-lookup.patch
new file mode 100644
index 0000000..f66978f
--- /dev/null
+++ b/rpm-4.13.90-silent-lookup.patch
@@ -0,0 +1,94 @@
+From 4afe09cbcfbc43c1385b8626e69bea216600ee59 Mon Sep 17 00:00:00 2001
+Message-Id: <4afe09cbcfbc43c1385b8626e69bea216600ee59.1503051023.git.pmatilai@redhat.com>
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Fri, 18 Aug 2017 12:43:27 +0300
+Subject: [PATCH 1/2] Add a flag to allow quiet test for package existence with
+ lookupPackage()
+
+Turning "flag" into an actual bitfield requires testing for
+PART_NAME/PART_SUBNAME differently, no actual changes here though.
+---
+ build/rpmbuild_internal.h |  1 +
+ build/spec.c              | 16 +++++++++-------
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
+index c294d5ee2..439b7d3b5 100644
+--- a/build/rpmbuild_internal.h
++++ b/build/rpmbuild_internal.h
+@@ -138,6 +138,7 @@ struct Package_s {
+ 
+ #define PART_SUBNAME  0
+ #define PART_NAME     1
++#define PART_QUIET    2
+ 
+ /** \ingroup rpmbuild
+  * rpmSpec file parser states.
+diff --git a/build/spec.c b/build/spec.c
+index 17a9b7c5a..39599e284 100644
+--- a/build/spec.c
++++ b/build/spec.c
+@@ -73,7 +73,7 @@ rpmRC lookupPackage(rpmSpec spec, const char *name, int flag,Package *pkg)
+     }
+ 
+     /* Construct partial package name */
+-    if (flag == PART_SUBNAME) {
++    if (!(flag & PART_NAME)) {
+ 	rasprintf(&fullName, "%s-%s",
+ 		 headerGetString(spec->packages->header, RPMTAG_NAME), name);
+ 	name = fullName;
+@@ -87,12 +87,14 @@ rpmRC lookupPackage(rpmSpec spec, const char *name, int flag,Package *pkg)
+ 	}
+     }
+ 
+-    if (p == NULL && pkg != NULL) {
+-	rpmlog(RPMLOG_ERR, _("line %d: %s: package %s does not exist\n"),
+-				spec->lineNum, spec->line, name);
+-    } else if (p != NULL && pkg == NULL) {
+-	rpmlog(RPMLOG_ERR, _("line %d: %s: package %s already exists\n"),
+-				spec->lineNum, spec->line, name);
++    if (!(flag & PART_QUIET)) {
++	if (p == NULL && pkg != NULL) {
++	    rpmlog(RPMLOG_ERR, _("line %d: %s: package %s does not exist\n"),
++				    spec->lineNum, spec->line, name);
++	} else if (p != NULL && pkg == NULL) {
++	    rpmlog(RPMLOG_ERR, _("line %d: %s: package %s already exists\n"),
++				    spec->lineNum, spec->line, name);
++	}
+     }
+ 
+     if (fullName == name)
+-- 
+2.13.5
+
+From 054de0f50fc1c8aacb6c45fa4a0fcd8d9ce5b2d1 Mon Sep 17 00:00:00 2001
+Message-Id: <054de0f50fc1c8aacb6c45fa4a0fcd8d9ce5b2d1.1503051023.git.pmatilai@redhat.com>
+In-Reply-To: <4afe09cbcfbc43c1385b8626e69bea216600ee59.1503051023.git.pmatilai@redhat.com>
+References: <4afe09cbcfbc43c1385b8626e69bea216600ee59.1503051023.git.pmatilai@redhat.com>
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Fri, 18 Aug 2017 12:46:59 +0300
+Subject: [PATCH 2/2] Use silent lookup for debuginfo packages (#1482144)
+
+Noarch packages do not have debuginfo, this was causing harmless
+but bogus error messages via lookupPackage(). Depends on commit
+4afe09cbcfbc43c1385b8626e69bea216600ee59.
+---
+ build/files.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/files.c b/build/files.c
+index c7fe2485c..5e84532f1 100644
+--- a/build/files.c
++++ b/build/files.c
+@@ -2981,7 +2981,7 @@ static int addDebugSrc(Package pkg, char *buildroot)
+ static Package findDebuginfoPackage(rpmSpec spec)
+ {
+     Package pkg = NULL;
+-    if (lookupPackage(spec, "debuginfo", PART_SUBNAME, &pkg))
++    if (lookupPackage(spec, "debuginfo", PART_SUBNAME|PART_QUIET, &pkg))
+ 	return NULL;
+     return pkg && pkg->fileList ? pkg : NULL;
+ }
+-- 
+2.13.5
+

diff --git a/rpm.spec b/rpm.spec
index 8fe7cc8..d1c4eb7 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -37,7 +37,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}5%{?dist}
+Release: %{?snapver:0.%{snapver}.}6%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://ftp.rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -66,6 +66,7 @@ Patch6: rpm-4.14-disable-sha256hdr.patch
 Patch7: rpm-4.13.90-macro-noquote.patch
 
 # Patches already upstream:
+Patch100: rpm-4.13.90-silent-lookup.patch
 
 # These are not yet upstream
 Patch906: rpm-4.7.1-geode-i686.patch
@@ -641,6 +642,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Fri Aug 18 2017 Panu Matilainen <pmatilai@redhat.com> - 4.13.90-0.git14000.6
+- Silence harmless but bogus error message on noarch packages (#1482144)
+
 * Thu Aug 17 2017 Miro Hrončok <mhroncok@redhat.com> - 4.13.90-0.git14002.5
 - Build with platform_python
 

                 reply	other threads:[~2026-11-23  9:31 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=179542628814.1.5008499891209542671.rpms-rpm-6f54bf086ac3@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