[FIX] devel/p5-Carp-Datum runtime fails

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[FIX] devel/p5-Carp-Datum runtime fails

Charlene Wendling
Hi ports!  

While working on an update for devel/p5-Getargs-Long, i've found out
that Carp::Datum is broken at runtime: 'defined %hash' is a fatal error
since Perl 5.22 [1].

The following diff, coming from Debian [2], fixes that. 'make test'
passes. I've also removed a spacing inconsistency while here.

Any comment?

Charlène.


[1]
https://perldoc.perl.org/5.22.0/perldelta.html#defined(%40array)-and-defined(%25hash)-are-now-fatal-errors
[2] https://rt.cpan.org/Public/Bug/Display.html?id=105296


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/p5-Carp-Datum/Makefile,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 Makefile
--- Makefile 5 Dec 2017 16:25:45 -0000 1.15
+++ Makefile 10 Feb 2019 10:18:37 -0000
@@ -5,9 +5,9 @@ COMMENT= debugging and tracing ultimate
 MODULES= cpan
 PKG_ARCH= *
 DISTNAME= Carp-Datum-0.1.3
-REVISION= 3
+REVISION= 4
 CATEGORIES= devel perl5
-FIX_EXTRACT_PERMISSIONS=Yes
+FIX_EXTRACT_PERMISSIONS= Yes
 
 # Artistic License
 PERMIT_PACKAGE_CDROM= Yes
Index: patches/patch-Datum_Parser_pm
===================================================================
RCS file: patches/patch-Datum_Parser_pm
diff -N patches/patch-Datum_Parser_pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Datum_Parser_pm 10 Feb 2019 10:18:37 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+"defined %hash" is an error in perl 5.22+
+Index: Datum/Parser.pm
+--- Datum/Parser.pm.orig
++++ Datum/Parser.pm
+@@ -1102,7 +1102,7 @@ sub yy_keyword {
+                 'usr2'         => $USR2,
+                 'warning'      => $WARNING,
+                 'yes'          => $YES
+-               ) unless defined %Keyword;
++               ) unless %Keyword;
+     return undef unless /^(\w+)/ && exists $Keyword{$1};
+     my $word = $1;
+     s/^\w+//;
Index: patches/patch-Datum_Parser_y
===================================================================
RCS file: patches/patch-Datum_Parser_y
diff -N patches/patch-Datum_Parser_y
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Datum_Parser_y 10 Feb 2019 10:18:37 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+"defined %hash" is an error in perl 5.22+
+Index: Datum/Parser.y
+--- Datum/Parser.y.orig
++++ Datum/Parser.y
+@@ -581,7 +581,7 @@ sub yy_keyword {
+                 'usr2'         => $USR2,
+                 'warning'      => $WARNING,
+                 'yes'          => $YES
+-               ) unless defined %Keyword;
++               ) unless %Keyword;
+     return undef unless /^(\w+)/ && exists $Keyword{$1};
+     my $word = $1;
+     s/^\w+//;
Index: patches/patch-Datum_pm
===================================================================
RCS file: patches/patch-Datum_pm
diff -N patches/patch-Datum_pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Datum_pm 10 Feb 2019 10:18:37 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+"defined %hash" is an error in perl 5.22+
+Index: Datum.pm
+--- Datum.pm.orig
++++ Datum.pm
+@@ -315,7 +315,7 @@ sub DTRACE {
+ TRC_NOTICE() => [\&logsay, undef],
+ TRC_INFO() => [\&logtrc, 'info'],
+ TRC_DEBUG() => [\&logtrc, 'debug'],
+- ) unless defined %Carp::Datum::logmap;
++ ) unless %Carp::Datum::logmap;
+
+ my $entry = $Carp::Datum::logmap{$level};
+

Reply | Threaded
Open this post in threaded view
|

Re: [FIX] devel/p5-Carp-Datum runtime fails

Alexander Bluhm
On Sun, Feb 10, 2019 at 11:40:34AM +0100, Charlene Wendling wrote:
> While working on an update for devel/p5-Getargs-Long, i've found out
> that Carp::Datum is broken at runtime: 'defined %hash' is a fatal error
> since Perl 5.22 [1].
>
> The following diff, coming from Debian [2], fixes that. 'make test'
> passes. I've also removed a spacing inconsistency while here.
>
> Any comment?

OK bluhm@

>  CATEGORIES= devel perl5

There are only 20 out of 1700 p5-* ports which set the perl5 category.
cpan.port.mk adds it automatically.  Can we remove this?