p5-forks: use version(3p)

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

p5-forks: use version(3p)

Klemens Nanni-2
Some Perl module versions in base use non-numerical version strings, but
forks.pm assumes numerical values.

Thanks to sthen for pointing at version(3p) here's a patch to fix it?

This lets me use p5-forks in my upcoming Slic3r port.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/p5-forks/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 12 May 2019 22:25:45 -0000 1.1.1.1
+++ Makefile 10 Jun 2019 12:55:16 -0000
@@ -3,6 +3,7 @@
 COMMENT = forks - emulate threads with fork
 
 DISTNAME = forks-0.36
+REVISION = 0
 
 CATEGORIES = devel
 
Index: patches/patch-lib_forks_pm
===================================================================
RCS file: patches/patch-lib_forks_pm
diff -N patches/patch-lib_forks_pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_forks_pm 10 Jun 2019 13:00:20 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Argument "3.08_01" isn't numeric in numeric ge (>=) at /usr/local/libdata/perl5/site_perl/amd64-openbsd/forks.pm line 1570.
+
+Index: lib/forks.pm
+--- lib/forks.pm.orig
++++ lib/forks.pm
+@@ -44,6 +44,7 @@ use strict;
+ use warnings;
+ use warnings::register;
+ use Carp ();
++use version;
+
+ #---------------------------------------------------------------------------
+ # Set when to execute check and end blocks
+@@ -1567,8 +1568,8 @@ sub _server {
+    
+ # Localize Storable variables to allow CODE refs, if using Storable >= 2.05
+
+-    local $Storable::Deparse = 1 if $Storable::VERSION >= 2.05;
+-    local $Storable::Eval = 1 if $Storable::VERSION >= 2.05;
++    local $Storable::Deparse = 1 if version->parse($Storable::VERSION) >= version->parse(2.05);
++    local $Storable::Eval = 1 if version->parse($Storable::VERSION) >= version->parse(2.05);
+
+ # Initialize the number of polls
+ # While we're running in the main dispatch loop

Reply | Threaded
Open this post in threaded view
|

Re: p5-forks: use version(3p)

Klemens Nanni-2
On Mon, Jun 10, 2019 at 03:03:30PM +0200, Klemens Nanni wrote:
> Some Perl module versions in base use non-numerical version strings, but
> forks.pm assumes numerical values.
>
> Thanks to sthen for pointing at version(3p) here's a patch to fix it?
>
> This lets me use p5-forks in my upcoming Slic3r port.
>
> OK?
Ping.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/p5-forks/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 Makefile
--- Makefile 12 May 2019 22:25:45 -0000 1.1.1.1
+++ Makefile 17 Jun 2019 21:02:16 -0000
@@ -3,6 +3,7 @@
 COMMENT = forks - emulate threads with fork
 
 DISTNAME = forks-0.36
+REVISION = 0
 
 CATEGORIES = devel
 
Index: patches/patch-lib_forks_pm
===================================================================
RCS file: patches/patch-lib_forks_pm
diff -N patches/patch-lib_forks_pm
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_forks_pm 17 Jun 2019 21:02:16 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Argument "3.08_01" isn't numeric in numeric ge (>=) at /usr/local/libdata/perl5/site_perl/amd64-openbsd/forks.pm line 1570.
+
+Index: lib/forks.pm
+--- lib/forks.pm.orig
++++ lib/forks.pm
+@@ -44,6 +44,7 @@ use strict;
+ use warnings;
+ use warnings::register;
+ use Carp ();
++use version;
+
+ #---------------------------------------------------------------------------
+ # Set when to execute check and end blocks
+@@ -1567,8 +1568,8 @@ sub _server {
+    
+ # Localize Storable variables to allow CODE refs, if using Storable >= 2.05
+
+-    local $Storable::Deparse = 1 if $Storable::VERSION >= 2.05;
+-    local $Storable::Eval = 1 if $Storable::VERSION >= 2.05;
++    local $Storable::Deparse = 1 if version->parse($Storable::VERSION) >= version->parse(2.05);
++    local $Storable::Eval = 1 if version->parse($Storable::VERSION) >= version->parse(2.05);
+
+ # Initialize the number of polls
+ # While we're running in the main dispatch loop

Reply | Threaded
Open this post in threaded view
|

Re: p5-forks: use version(3p)

Stuart Henderson
On 2019/06/17 23:02, Klemens Nanni wrote:

> On Mon, Jun 10, 2019 at 03:03:30PM +0200, Klemens Nanni wrote:
> > Some Perl module versions in base use non-numerical version strings, but
> > forks.pm assumes numerical values.
> >
> > Thanks to sthen for pointing at version(3p) here's a patch to fix it?
> >
> > This lets me use p5-forks in my upcoming Slic3r port.
> >
> > OK?
> Ping.

OK.

Thanks for re-inlining the diff rather than just relying on the quote :)