public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Lubos Kardos <lkardos@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - Don't warn when an escaped macro is in a comment
Date: Mon, 23 Nov 2026 09:29:31 GMT	[thread overview]
Message-ID: <179542617153.1.16048682496798514130.rpms-rpm-977533abf2b7@fedoraproject.org> (raw)

            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)
 

                 reply	other threads:[~2026-11-23  9:29 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=179542617153.1.16048682496798514130.rpms-rpm-977533abf2b7@fedoraproject.org \
    --to=lkardos@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