]> git.pld-linux.org Git - packages/rpm.git/commitdiff
make perl's heredoc matching more generic to get rid of bogus reqs; rel 6 auto/th/rpm-4.17.1.1-6
authorJan Palus <atler@pld-linux.org>
Tue, 12 Dec 2023 20:36:53 +0000 (21:36 +0100)
committerJan Palus <atler@pld-linux.org>
Tue, 12 Dec 2023 20:36:53 +0000 (21:36 +0100)
from: https://github.com/rpm-software-management/rpm/pull/2813

perl-heredoc-matching.patch [new file with mode: 0644]
rpm.spec

diff --git a/perl-heredoc-matching.patch b/perl-heredoc-matching.patch
new file mode 100644 (file)
index 0000000..8ad0160
--- /dev/null
@@ -0,0 +1,39 @@
+From 73419594af15e94e77bae413d9754d3775cf0280 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus@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;
index a986e7623ddee08419f3bee959b2f6e66e737d1a..a618e84c238f55e85b84da7dadfed5db4dace925 100644 (file)
--- 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
 
This page took 0.051994 seconds and 4 git commands to generate.