tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: p5-Mail-Box 2.102nb2: warning message



Hi,

patch request below.

On Thu, Dec 26, 2013 at 10:56:37PM +0100, Ignatios Souvatzis wrote:
> 
> while running something that uses mail/p5-Mail-Box-2.102nb2
> 
> I get
> 
> overload arg '+0' is invalid at 
> /usr/pkg/lib/perl5/vendor_perl/5.18.0/Mail/Message/Field.pm line 29.
> 
> The lines in question are:
> 
> use overload
>     qq("") => sub { $_[0]->unfoldedBody }
>  , '+0'   => sub { $_[0]->toInt || 0 }
>  , bool   => sub {1}
>  , cmp    => sub { $_[0]->unfoldedBody cmp "$_[1]" }
>  , '<=>'  => sub { $_[2] ? $_[1] <=> $_[0]->toInt : $_[0]->toInt <=> $_[1] }
>  , fallback => 1;
> 
> I don't talk enough modern Perl to understand what that
> is about, but I note that the upstream versions 2.106 and up
> (latest is 2.108) have '0+' there.

So, '+0' is indeed a bug, the Venus operator for overload has to
be written as '0+', see also

<http://search.cpan.org/~book/perlsecret-1.004/lib/perlsecret.pod#Venus__0+__or__+0>

The obvious quick patch is below; is it too late to commit it?
After 2013Q4 we should probably update the package to last upstreams;
but I don't know what interactions with other packages' potentially
old versions in pkgsrc might appear.

        -is


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/p5-Mail-Box/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- Makefile    9 Dec 2013 14:17:49 -0000       1.20
+++ Makefile    27 Dec 2013 10:00:10 -0000
@@ -2,7 +2,7 @@
 
 DISTNAME=      Mail-Box-2.102
 PKGNAME=       p5-${DISTNAME}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    mail perl5
 MASTER_SITES=  ${MASTER_SITE_PERL_CPAN:=Mail/}
 
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/mail/p5-Mail-Box/distinfo,v
retrieving revision 1.7
diff -u -r1.7 distinfo
--- distinfo    11 Feb 2012 03:21:35 -0000      1.7
+++ distinfo    27 Dec 2013 10:00:10 -0000
@@ -4,3 +4,4 @@
 RMD160 (Mail-Box-2.102.tar.gz) = abc9bf4dedc47b75f458a0636e6f1b57bd45d0e3
 Size (Mail-Box-2.102.tar.gz) = 612927 bytes
 SHA1 (patch-aa) = 91a9f9f42bf25df5dcaf27ffb0ce0ba5b0caefc4
+SHA1 (patch-lib_Message_Field.pm) = 838887204aa394b43a3ceaab9b399adbb55a540b
Index: patches/patch-lib_Message_Field.pm
===================================================================
RCS file: patches/patch-lib_Message_Field.pm
diff -N patches/patch-lib_Message_Field.pm
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Message_Field.pm  27 Dec 2013 10:00:10 -0000
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/Mail/Message/Field.pm.orig     2012-01-04 08:35:33.000000000 +0000
++++ lib/Mail/Message/Field.pm
+@@ -22,7 +22,7 @@ my $default_wrap_length = 78;
+ 
+ use overload
+     qq("") => sub { $_[0]->unfoldedBody }
+- , '+0'   => sub { $_[0]->toInt || 0 }
++ , '0+'   => sub { $_[0]->toInt || 0 }
+  , bool   => sub {1}
+  , cmp    => sub { $_[0]->unfoldedBody cmp "$_[1]" }
+  , '<=>'  => sub { $_[2] ? $_[1] <=> $_[0]->toInt : $_[0]->toInt <=> $_[1] }

Attachment: pgp0NPLEZqco5.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index