From 977533abf2b72d3828a1bcd7b596f418f8cbd27b Mon Sep 17 00:00:00 2001 From: Lubos Kardos Date: Jul 30 2015 14:50:54 +0000 Subject: - 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 +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 - 4.12.90-4 +- Don't warn when an escaped macro is in a comment (#1224660) + * Mon Jul 27 2015 Florian Festi - 4.12.90-3 - Fix compressed patches (#1247248)