tags 809101 patch
user ubuntu-de...@lists.ubuntu.com
usertags 809101 ubuntu-patch xenial
thanks

On Sun, Dec 27, 2015 at 01:36:49PM +0200, Niko Tyni wrote:
> This package now warns on usage, and makes its reverse dependencies
> like libmoosex-types-iso8601-perl do so as well.
> 
> % perl -w -e 'use DateTime::Format::Duration'
> Unescaped left brace in regex is deprecated, passed through in regex; marked 
> by <-- HERE in m/%{ <-- HERE (\w+)}/ at 
> /usr/share/perl5/DateTime/Format/Duration.pm line 583.
> Unescaped left brace in regex is deprecated, passed through in regex; marked 
> by <-- HERE in m/(%{ <-- HERE (\w+)})/ at 
> /usr/share/perl5/DateTime/Format/Duration.pm line 584.

https://github.com/karenetheridge/DateTime-Format-Duration/commit/640674988a1e62a780967d5045df5f2ed2987cde
fixes this and can be cherry-picked as follows, although a maintainer
upload should possibly just upgrade to 1.04.

  * Cherry-pick from upstream: fix "Unescaped left brace in regex is
    deprecated" warning in 5.22+ (closes: #809101).

--- libdatetime-format-duration-perl-1.03a.orig/lib/DateTime/Format/Duration.pm
+++ libdatetime-format-duration-perl-1.03a/lib/DateTime/Format/Duration.pm
@@ -580,8 +580,8 @@
 
 
        # Any function in DateTime.
-       $regex =~ s|%{(\w+)}|($tempdur->can($1)) ? "(.+)" : ".+"|eg;
-       $field_list =~ s|(%{(\w+)})|($tempdur->can($2)) ? "#$2#" : $1 |eg;
+       $regex =~ s|%\{(\w+)}|($tempdur->can($1)) ? "(.+)" : ".+"|eg;
+       $field_list =~ s|(%\{(\w+)})|($tempdur->can($2)) ? "#$2#" : $1 |eg;
 
        # White space:
        $regex =~ s/%(\d*)[tn]/($1) ? "\\s{$1}" : "\\s+"/eg;

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]

Reply via email to