Dne Čt 18.čen.2015 09:43:02, ppisar napsal(a):
Show quoted text> Running tests with perl-5.22.0 shows:
>
> t/priority.t ........ Unescaped left brace in regex is deprecated,
> passed through in regex; marked by <-- HERE in m/\${ <-- HERE
> priority}/ at /home/test/rpmbuild/BUILD/Log-Agent-
> 1.000/blib/lib/Log/Agent/Tag/Priority.pm line 84.
Attached patch fixes it.
From e679ea177cb2570488a7108d7a16e866eecde0fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Thu, 18 Jun 2015 15:45:13 +0200
Subject: [PATCH] Escape non-quantifying curly brackets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since perl 5.22.0, literal curly bracket in a regualar expression
raises a warning. This patch fixes these typos.
CPAN RT#105329
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
Agent/Tag/Caller.pm | 8 ++++----
Agent/Tag/Priority.pm | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Agent/Tag/Caller.pm b/Agent/Tag/Caller.pm
index 89e1ea9..1bf7aff 100644
--- a/Agent/Tag/Caller.pm
+++ b/Agent/Tag/Caller.pm
@@ -178,13 +178,13 @@ sub string {
my $display = $self->display;
if ($display) {
$display =~ s/\$pack(?:age)?\b/$package/g;
- $display =~ s/\${pack(?:age)?}/$package/g;
+ $display =~ s/\$\{pack(?:age)?\}/$package/g;
$display =~ s/\$file(?:name)?\b/$filename/g;
- $display =~ s/\${file(?:name)?}/$filename/g;
+ $display =~ s/\$\{file(?:name)?\}/$filename/g;
$display =~ s/\$line\b/$line/g;
- $display =~ s/\${line}/$line/g;
+ $display =~ s/\$\{line\}/$line/g;
$display =~ s/\$sub(?:routine)?\b/$subroutine/g;
- $display =~ s/\${sub(?:routine)?}/$subroutine/g;
+ $display =~ s/\$\{sub(?:routine)?\}/$subroutine/g;
} else {
my @show = map { $caller[$_] } @{$self->indices};
my $format = $self->format || ($self->postfix ? "[%a]" : "(%a)");
diff --git a/Agent/Tag/Priority.pm b/Agent/Tag/Priority.pm
index 2013ad5..8fb6ea6 100644
--- a/Agent/Tag/Priority.pm
+++ b/Agent/Tag/Priority.pm
@@ -81,9 +81,9 @@ sub make {
#
$display =~ s/\$priority\b/$priority/g;
- $display =~ s/\${priority}/$priority/g;
+ $display =~ s/\$\{priority\}/$priority/g;
$display =~ s/\$level\b/$level/g;
- $display =~ s/\${level}/$level/g;
+ $display =~ s/\$\{level\}/$level/g;
#
# Now create the constant tag string.
--
2.1.0