public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: - Don't warn when an escaped macro is in a comment
@ 2026-11-23  9:29 Lubos Kardos
  0 siblings, 0 replies; only message in thread
From: Lubos Kardos @ 2026-11-23  9:29 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpm
            Branch : pmatilai-v6
            Commit : 977533abf2b72d3828a1bcd7b596f418f8cbd27b
            Author : Lubos Kardos <lkardos@redhat.com>
            Date   : 2015-07-30T16:50:54+02:00
            Stats  : +53/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpm/c/977533abf2b72d3828a1bcd7b596f418f8cbd27b?branch=pmatilai-v6

            Log:
            - Don't warn when an escaped macro is in a comment
- Related: #1224660

---
diff --git a/rpm-4.12.90-fix-macro-warning.patch b/rpm-4.12.90-fix-macro-warning.patch
new file mode 100644
index 0000000..aab5cf8
--- /dev/null
+++ b/rpm-4.12.90-fix-macro-warning.patch
@@ -0,0 +1,48 @@
+From 655ca18630d4a89e022b51ea495fa63718303413 Mon Sep 17 00:00:00 2001
+From: Lubos Kardos <lkardos@redhat.com>
+Date: Thu, 30 Jul 2015 16:23:58 +0200
+Subject: [PATCH] Don't warn when an escaped macro is in comment.
+
+- Related to 2a3f49585e5bd82d0bbfe5b9d6cdf24d9501b5cd
+---
+ build/parseSpec.c | 23 ++++++++++++++++++-----
+ 1 file changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/build/parseSpec.c b/build/parseSpec.c
+index 706579d..edc3d00 100644
+--- a/build/parseSpec.c
++++ b/build/parseSpec.c
+@@ -189,12 +189,25 @@ static int expandMacrosInSpecBuf(rpmSpec spec, int strip)
+ 	goto exit;
+     }
+ 
+-    if (strip & STRIP_COMMENTS &&
+-	isComment && !rstreq(spec->lbuf, lbuf)) {
++    if (strip & STRIP_COMMENTS && isComment) {
++	char *bufA = lbuf;
++	char *bufB = spec->lbuf;
+ 
+-	rpmlog(RPMLOG_WARNING,
+-	    _("Macro expanded in comment on line %d: %s\n"),
+-	    spec->lineNum, lbuf);
++	while (*bufA != '\0' && *bufB != '\0') {
++	    if (*bufA == '%' && *(bufA + 1) == '%')
++		bufA++;
++
++	    if (*bufA != *bufB)
++		break;
++
++	    bufA++;
++	    bufB++;
++	}
++
++	if (*bufA != '\0' || *bufB != '\0')
++	    rpmlog(RPMLOG_WARNING,
++		_("Macro expanded in comment on line %d: %s\n"),
++		spec->lineNum, lbuf);
+     }
+ 
+ exit:
+-- 
+1.9.3
+

diff --git a/rpm.spec b/rpm.spec
index abdb61d..c3a7ab2 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -27,7 +27,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}3%{?dist}
+Release: %{?snapver:0.%{snapver}.}4%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/rpm-4.12.x/%{name}-%{srcver}.tar.bz2
@@ -52,6 +52,7 @@ Patch5: rpm-4.12.0-rpm2cpio-hack.patch
 # Patches already upstream:
 Patch100: rpm-4.12.90-braces-expansion.patch
 Patch101: rpm-4.12.90-Fix-compressed-patches.patch
+Patch102: rpm-4.12.90-fix-macro-warning.patch
 
 # These are not yet upstream
 Patch302: rpm-4.7.1-geode-i686.patch
@@ -536,6 +537,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Thu Jul 30 2015 Lubos Kardos <lkardos@redhat.com> - 4.12.90-4
+- Don't warn when an escaped macro is in a comment (#1224660)
+
 * Mon Jul 27 2015 Florian Festi <ffesti@rpm.org> - 4.12.90-3
 - Fix compressed patches (#1247248)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:29 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:29 [rpms/rpm] pmatilai-v6: - Don't warn when an escaped macro is in a comment Lubos Kardos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox