diff --git a/a69b48eda3ebd66eec30a34a377c7a00c6f8e36c.patch b/a69b48eda3ebd66eec30a34a377c7a00c6f8e36c.patch new file mode 100644 index 0000000..62d3fa7 --- /dev/null +++ b/a69b48eda3ebd66eec30a34a377c7a00c6f8e36c.patch @@ -0,0 +1,29 @@ +From a69b48eda3ebd66eec30a34a377c7a00c6f8e36c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= +Date: Thu, 20 May 2021 08:48:25 +0200 +Subject: [PATCH] Instead of using a regex, use subsbtring matching for flags + +This change mitigates #302 when perl exhibits the bug +https://github.com/Perl/perl5/issues/18604 + +and seems to speed up flag matching. + +fix #302 +--- + NEWS | 1 + + lib/Locale/Po4a/Po.pm | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/Locale/Po4a/Po.pm b/lib/Locale/Po4a/Po.pm +index 5127bf6ea..16c0689fe 100644 +--- a/lib/Locale/Po4a/Po.pm ++++ b/lib/Locale/Po4a/Po.pm +@@ -1467,7 +1467,7 @@ sub push_raw { + $flags = " $flags "; + $flags =~ s/,/ /g; + foreach my $flag (@known_flags) { +- if ( $flags =~ /\s$flag\s/ ) { # if flag to be set ++ if (index($flags, " $flag ") != -1) { # if flag to be set + unless ( defined( $self->{po}{$msgid}{'flags'} ) + && $self->{po}{$msgid}{'flags'} =~ /\b$flag\b/ ) + { diff --git a/po4a.changes b/po4a.changes index a86da3c..7b3323d 100644 --- a/po4a.changes +++ b/po4a.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Sep 10 20:17:45 UTC 2021 - Marcus Rueckert + +- backport https://github.com/mquinson/po4a/commit/a69b48eda3ebd66eec30a34a377c7a00c6f8e36c.patch + this works around a memory leak in perl + https://github.com/Perl/perl5/issues/18604 + https://github.com/mquinson/po4a/issues/317 + https://github.com/mquinson/po4a/issues/302 + ------------------------------------------------------------------- Sat Jul 10 00:41:40 UTC 2021 - Pau Garcia Quiles diff --git a/po4a.spec b/po4a.spec index c8b7fc0..347c4b1 100644 --- a/po4a.spec +++ b/po4a.spec @@ -28,6 +28,7 @@ Group: Development/Tools/Other %endif URL: https://po4a.org/ Source: https://github.com/mquinson/po4a/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch0: https://github.com/mquinson/po4a/commit/a69b48eda3ebd66eec30a34a377c7a00c6f8e36c.patch %if "%{_vendor}" == "debbuild" BuildRequires: deb-perl-macros @@ -107,6 +108,7 @@ po4a supports currently the following formats: %prep %setup -q +%patch0 -p1 %build perl Build.PL installdirs=vendor