[packages/rpm] make perl's heredoc matching more generic to get rid of bogus reqs; rel 6
atler
atler at pld-linux.org
Tue Dec 12 21:48:54 CET 2023
commit 0810ed8a15cce0bacf56390206e515edef13a84e
Author: Jan Palus <atler at pld-linux.org>
Date: Tue Dec 12 21:36:53 2023 +0100
make perl's heredoc matching more generic to get rid of bogus reqs; rel 6
from: https://github.com/rpm-software-management/rpm/pull/2813
perl-heredoc-matching.patch | 39 +++++++++++++++++++++++++++++++++++++++
rpm.spec | 4 +++-
2 files changed, 42 insertions(+), 1 deletion(-)
---
diff --git a/rpm.spec b/rpm.spec
index a986e76..a618e84 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -34,7 +34,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM
Summary(uk.UTF-8): Менеджер пакетів від RPM
Name: rpm
Version: 4.17.1.1
-Release: 5
+Release: 6
Epoch: 1
License: GPL v2 / LGPL v2.1
Group: Base
@@ -95,6 +95,7 @@ Patch36: build-locale.patch
Patch37: no-exe-for-elf-req.patch
Patch38: gem-in-package-builddir.patch
Patch39: sqlite-log-crash.patch
+Patch40: perl-heredoc-matching.patch
URL: https://rpm.org/
BuildRequires: acl-devel
%{?with_audit:BuildRequires: audit-libs-devel}
@@ -675,6 +676,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
%patch37 -p1
%patch38 -p1
%patch39 -p1
+%patch40 -p1
%{__rm} po/*.gmo
diff --git a/perl-heredoc-matching.patch b/perl-heredoc-matching.patch
new file mode 100644
index 0000000..8ad0160
--- /dev/null
+++ b/perl-heredoc-matching.patch
@@ -0,0 +1,39 @@
+From 73419594af15e94e77bae413d9754d3775cf0280 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus at fastmail.com>
+Date: Tue, 12 Dec 2023 19:45:54 +0100
+Subject: [PATCH] perl.req: make heredoc block matching more generic
+
+match any <<MARKER providing:
+
+- it is not in comment (not preceded by #)
+- it can't be string literal (not preceded by ' or ")
+- as a sanity check it must be preceded by either whitespace, comma or
+ equals sign
+
+adds support for
+
+ return <<"EOS";
+
+ fun(arg, <<"EOS");
+---
+ scripts/perl.req | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/scripts/perl.req b/scripts/perl.req
+index 1b50c50847..8bfa38771e 100755
+--- a/scripts/perl.req
++++ b/scripts/perl.req
+@@ -102,10 +102,10 @@ sub process_file {
+
+ while (<FILE>) {
+
+- # skip the "= <<" block
++ # skip the heredoc block
+
+- if (m/^\s*(?:my\s*)?\$(?:.*)\s*=\s*<<\s*(["'`])(.+?)\1/ ||
+- m/^\s*(?:my\s*)?\$(.*)\s*=\s*<<(\w+)\s*;/) {
++ if (m/^[^'"#]+[\s,=(]<<\s*(["'`])(.+?)\1/ ||
++ m/^[^'"#]+[\s,=(](<<)(\w+)\s*;/) {
+ $tag = $2;
+ while (<FILE>) {
+ chomp;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/0810ed8a15cce0bacf56390206e515edef13a84e
More information about the pld-cvs-commit
mailing list