[libkinosearch1-perl] 01/06: Add patch from CPAN RT to fix test failure with 5.24.
gregor herrmann
gregoa at debian.org
Sun May 29 15:14:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libkinosearch1-perl.
commit fa3c9f3d74513980d3ea082020e4cefd7a494503
Author: gregor herrmann <gregoa at debian.org>
Date: Sun May 29 17:08:42 2016 +0200
Add patch from CPAN RT to fix test failure with 5.24.
Closes: #825233
---
.../KinoSearch1-1.01-Do-not-use-C-in-regexps.patch | 78 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 79 insertions(+)
diff --git a/debian/patches/KinoSearch1-1.01-Do-not-use-C-in-regexps.patch b/debian/patches/KinoSearch1-1.01-Do-not-use-C-in-regexps.patch
new file mode 100644
index 0000000..e407756
--- /dev/null
+++ b/debian/patches/KinoSearch1-1.01-Do-not-use-C-in-regexps.patch
@@ -0,0 +1,78 @@
+From 90b55f6267fa139df653147a106c8a58925fd451 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Thu, 19 May 2016 17:02:21 +0200
+Subject: [PATCH] Do not use \C in regexps
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Pelr 5.24.0 removed support for \C (bytes positions). This patch
+rewrites the tests for the ungreedy sequence of bytes with a miximum
+size.
+
+CPAN RT#105144
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=105144
+Bug-Debian: https://bugs.debian.org/825233
+
+---
+ lib/KinoSearch1/Highlight/Highlighter.pm | 23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/lib/KinoSearch1/Highlight/Highlighter.pm b/lib/KinoSearch1/Highlight/Highlighter.pm
+index bb8f910..50faca7 100644
+--- a/lib/KinoSearch1/Highlight/Highlighter.pm
++++ b/lib/KinoSearch1/Highlight/Highlighter.pm
+@@ -84,32 +84,39 @@ sub generate_excerpt {
+ $text = bytes::substr( $text, $top );
+
+ # try to start the excerpt at a sentence boundary
+- if ($text =~ s/
++ if ($text =~ /
+ \A
+ (
+- \C{0,$limit}?
++ (.*?)
+ \.\s+
+ )
+- //xsm
++ /xsm
++ and bytes::length($2) <= $limit
+ )
+ {
+- $top += bytes::length($1);
++ my $bytes_length = bytes::length($1);
++ $text = bytes::substr($text, $bytes_length);
++ $top += $bytes_length;
+ }
+ # no sentence boundary, so we'll need an ellipsis
+ else {
+ # skip past possible partial tokens, prepend an ellipsis
+- if ($text =~ s/
++ if ($text =~ /
+ \A
+ (
+- \C{0,$limit}? # don't go outside the window
++ (.*?) # don't go outside the window
+ $token_re # match possible partial token
+ .*? # ... and any junk following that token
+ )
+ (?=$token_re) # just before the start of a full token...
+- /... /xsm # ... insert an ellipsis
++ /xsm
++ and bytes::length($2) <= $limit # don't go outside the window
+ )
+ {
+- $top += bytes::length($1);
++ my $bytes_length = bytes::length($1);
++ # ... insert an ellipsis
++ $text = '... ' . bytes::substr($text, $bytes_length);
++ $top += $bytes_length;
+ $top -= 4 # three dots and a space
+ }
+ }
+--
+2.5.5
+
diff --git a/debian/patches/series b/debian/patches/series
index 20d2dc7..ff4f3b2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
0001-Sort-the-list-of-source-files-when-generating-XS-cod.patch
spelling.patch
+KinoSearch1-1.01-Do-not-use-C-in-regexps.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libkinosearch1-perl.git
More information about the Pkg-perl-cvs-commits
mailing list