tags 708025 + pending
thanks

Dear maintainer,

I've prepared an NMU for libtemplate-perl (versioned as 2.24-1.1) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

Regards.
Dominic (on behalf of Tamas)
diff -Nru libtemplate-perl-2.24/debian/changelog libtemplate-perl-2.24/debian/changelog
--- libtemplate-perl-2.24/debian/changelog	2012-04-10 19:06:00.000000000 +0200
+++ libtemplate-perl-2.24/debian/changelog	2013-08-17 20:04:30.000000000 +0200
@@ -1,3 +1,10 @@
+libtemplate-perl (2.24-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * apply fix from the upstream git to be compatible with Perl 5.18 (Closes: #708025)
+
+ -- CSILLAG Tamas <csta...@cstamas.hu>  Sat, 17 Aug 2013 15:17:25 +0200
+
 libtemplate-perl (2.24-1) unstable; urgency=low
 
   * New upstream release (Closes: #664561)
diff -Nru libtemplate-perl-2.24/debian/patches/series libtemplate-perl-2.24/debian/patches/series
--- libtemplate-perl-2.24/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ libtemplate-perl-2.24/debian/patches/series	2013-08-17 20:04:30.000000000 +0200
@@ -0,0 +1 @@
+vmethods-fix-for-perl5.18
diff -Nru libtemplate-perl-2.24/debian/patches/vmethods-fix-for-perl5.18 libtemplate-perl-2.24/debian/patches/vmethods-fix-for-perl5.18
--- libtemplate-perl-2.24/debian/patches/vmethods-fix-for-perl5.18	1970-01-01 01:00:00.000000000 +0100
+++ libtemplate-perl-2.24/debian/patches/vmethods-fix-for-perl5.18	2013-08-17 20:10:23.000000000 +0200
@@ -0,0 +1,84 @@
+Description: apply fix from the upstream git to be compatible with Perl 5.18
+ Rewrite split handling to use qr// which is consistent before and after
+ the Perl 5.18.0 changes.
+ 
+ In perldelta 5.18.0 it reads:
+ 
+ split's first argument is more consistently interpreted
+ 
+ After some changes earlier in v5.17, split's behavior has been
+ simplified: if the PATTERN argument evaluates to a string containing
+ one space, it is treated the way that a literal string containing
+ one space once was.
+
+ Also apply a fix to be backward compatible.
+
+ from https://github.com/abw/Template2/commit/0caac1347e2e3f2fc290f0a4ffc0281b5df68abb
+ and  https://github.com/abw/Template2/commit/5d732184712342cdb3750f52b03f8dcc3740b53d
+ .
+ libtemplate-perl (2.24-1.1) unstable; urgency=low
+ .
+
+Author: CSILLAG Tamas <csta...@cstamas.hu>
+Author: Andy Wardley <a...@wardley.org>
+Origin: upstream, https://github.com/abw/Template2/commit/0caac1347e2e3f2fc290f0a4ffc0281b5df68abb https://github.com/abw/Template2/commit/5d732184712342cdb3750f52b03f8dcc3740b53d
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=84778
+Bug-Debian: http://bugs.debian.org/708025
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=84778
+Last-Update: 2013-08-17
+
+--- libtemplate-perl-2.24.orig/lib/Template/VMethods.pm
++++ libtemplate-perl-2.24/lib/Template/VMethods.pm
+@@ -254,21 +254,40 @@ sub text_split {
+     my ($str, $split, $limit) = @_;
+     $str = '' unless defined $str;
+ 
+-    # we have to be very careful about spelling out each possible
+-    # combination of arguments because split() is very sensitive
+-    # to them, for example C<split(' ', ...)> behaves differently
+-    # to C<$space=' '; split($space, ...)>
++    # For versions of Perl prior to 5.18 we have to be very careful about
++    # spelling out each possible combination of arguments because split()
++    # is very sensitive to them, for example C<split(' ', ...)> behaves
++    # differently to C<$space=' '; split($space, ...)>.  Test 33 of 
++    # vmethods/text.t depends on this behaviour.
+ 
+-    if (defined $limit) {
+-        return [ defined $split
+-                 ? split($split, $str, $limit)
+-                 : split(' ', $str, $limit) ];
++    if ($] < 5.018) {
++        if (defined $limit) {
++            return [ defined $split
++                     ? split($split, $str, $limit)
++                     : split(' ', $str, $limit) ];
++        }
++        else {
++            return [ defined $split
++                     ? split($split, $str)
++                     : split(' ', $str) ];
++        }
+     }
+-    else {
+-        return [ defined $split
+-                 ? split($split, $str)
+-                 : split(' ', $str) ];
++
++    # split's behavior changed in Perl 5.18.0 making this:
++    # C<$space=' '; split($space, ...)>
++    # behave the same as this:
++    # C<split(' ', ...)>
++    # qr// behaves the same, so use that for user-defined split.
++
++    my $split_re;
++    if (defined $split) {
++        eval {
++            $split_re = qr/$split/;
++        };
+     }
++    $split_re = ' ' unless defined $split_re;
++    $limit ||= 0;
++    return [split($split_re, $str, $limit)];
+ }
+ 
+ sub text_chunk {

Reply via email to