r75805 - in /trunk/libmoo-perl: ./ debian/ lib/ lib/Method/Generate/ lib/Moo/ lib/Role/ lib/Sub/ maint/ t/

fabreg-guest at users.alioth.debian.org fabreg-guest at users.alioth.debian.org
Wed Jun 15 21:28:09 UTC 2011


Author: fabreg-guest
Date: Wed Jun 15 21:27:59 2011
New Revision: 75805

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=75805
Log:
Updated package

Added:
    trunk/libmoo-perl/t/load_module_role_tiny.t
      - copied unchanged from r75804, branches/upstream/libmoo-perl/current/t/load_module_role_tiny.t
Modified:
    trunk/libmoo-perl/Changes
    trunk/libmoo-perl/MANIFEST
    trunk/libmoo-perl/META.yml
    trunk/libmoo-perl/Makefile.PL
    trunk/libmoo-perl/debian/changelog
    trunk/libmoo-perl/debian/control
    trunk/libmoo-perl/debian/copyright
    trunk/libmoo-perl/lib/Method/Generate/Accessor.pm
    trunk/libmoo-perl/lib/Moo.pm
    trunk/libmoo-perl/lib/Moo/_Utils.pm
    trunk/libmoo-perl/lib/Role/Tiny.pm
    trunk/libmoo-perl/lib/Sub/Quote.pm
    trunk/libmoo-perl/maint/Makefile.PL.include
    trunk/libmoo-perl/t/accessor-weaken.t
    trunk/libmoo-perl/t/load_module.t
    trunk/libmoo-perl/t/sub-quote.t

Modified: trunk/libmoo-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/Changes?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/Changes (original)
+++ trunk/libmoo-perl/Changes Wed Jun 15 21:27:59 2011
@@ -1,3 +1,7 @@
+0.009008 - 2011-06-03
+  - transfer fix to _load_module to Role::Tiny and make a note it's an inline
+  - Bring back 5.8.1 compat
+
 0.009007 - 2011-02-25
   - I botched the copyright. re-disting.
 

Modified: trunk/libmoo-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/MANIFEST?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/MANIFEST (original)
+++ trunk/libmoo-perl/MANIFEST Wed Jun 15 21:27:59 2011
@@ -29,6 +29,7 @@
 t/compose-roles.t
 t/extends-non-moo.t
 t/load_module.t
+t/load_module_role_tiny.t
 t/method-generate-accessor.t
 t/method-generate-constructor.t
 t/moo-accessors.t

Modified: trunk/libmoo-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/META.yml?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/META.yml (original)
+++ trunk/libmoo-perl/META.yml Wed Jun 15 21:27:59 2011
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               Moo
-version:            0.009007
+version:            0.009008
 abstract:           Minimalist Object Orientation (with Moose compatiblity)
 author:
     - mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>

Modified: trunk/libmoo-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/Makefile.PL?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/Makefile.PL (original)
+++ trunk/libmoo-perl/Makefile.PL Wed Jun 15 21:27:59 2011
@@ -1,6 +1,6 @@
 use strict;
 use warnings FATAL => 'all';
-use 5.008003;
+use 5.008001;
 use ExtUtils::MakeMaker;
 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
 

Modified: trunk/libmoo-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/debian/changelog?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/debian/changelog (original)
+++ trunk/libmoo-perl/debian/changelog Wed Jun 15 21:27:59 2011
@@ -1,3 +1,13 @@
+libmoo-perl (0.009008-1) UNRELEASED; urgency=low
+
+  * New upstream release
+  * Bump to 3.9.2 Standard-Version.
+  * Switch to DEP5 license format.
+  * Add myself to Uploaders.
+  * Update Format-Specification link. 
+
+ -- Fabrizio Regalli <fabreg at fabreg.it>  Wed, 15 Jun 2011 23:17:43 +0200
+
 libmoo-perl (0.009007-1) unstable; urgency=low
 
   * Initial Release. (Closes: #614940)

Modified: trunk/libmoo-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/debian/control?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/debian/control (original)
+++ trunk/libmoo-perl/debian/control Wed Jun 15 21:27:59 2011
@@ -6,8 +6,8 @@
  libstrictures-perl, libtest-fatal-perl (>= 0.003),
  libtest-simple-perl (>= 0.96), perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Maximilian Gass <mxey at cloudconnected.org>
-Standards-Version: 3.9.1
+Uploaders: Maximilian Gass <mxey at cloudconnected.org>, Fabrizio Regalli <fabreg at fabreg.it>
+Standards-Version: 3.9.2
 Homepage: http://search.cpan.org/dist/Moo/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libmoo-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libmoo-perl/

Modified: trunk/libmoo-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/debian/copyright?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/debian/copyright (original)
+++ trunk/libmoo-perl/debian/copyright Wed Jun 15 21:27:59 2011
@@ -1,22 +1,24 @@
-Format: http://dep.debian.net/deps/dep5/
-Upstream-Name: Moo
-Upstream-Contact: Matt S Trout <mst at shadowcat.co.uk>
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Maintainer: mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>
 Source: http://search.cpan.org/dist/Moo/
+Name: Moo
+DISCLAIMER: This copyright info was automatically extracted 
+ from the perl module. It may not be accurate, so you better 
+ check the module sources in order to ensure the module for its 
+ inclusion in Debian or for general legal information. Please, 
+ if licensing information is incorrectly generated, file a bug 
+ on dh-make-perl.
+ NOTE: Don't forget to remove this disclaimer once you are happy
+ with this file.
 
 Files: *
-Copyright: 2010-2011, Matt S. Trout <mst at shadowcat.co.uk>
-           2010-2011, David Leadbeater <dgl at dgl.cx>
-           2010-2011, Arthur Axel "fREW" Schmidt <frioux at gmail.com>
-           2010-2011, Andrew Rodland <arodland at cpan.org>
-           2010-2011, John Napiorkowski <jjn1056 at yahoo.com>
-           2010-2011, Peter Rabbitson <ribasushi at cpan.org>
+Copyright: mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>
 License: Artistic or GPL-1+
 
-
 Files: debian/*
-Copyright: 2011, Maximilian Gass <mxey at cloudconnected.org>
+Copyright: 2011, Fabrizio Regalli <fabreg at fabreg.it>
+ 2011, Maximilian Gass <mxey at cloudconnected.org>
 License: Artistic or GPL-1+
-
 
 License: Artistic
  This program is free software; you can redistribute it and/or modify
@@ -33,4 +35,3 @@
  .
  On Debian systems, the complete text of version 1 of the GNU General
  Public License can be found in `/usr/share/common-licenses/GPL-1'.
-

Modified: trunk/libmoo-perl/lib/Method/Generate/Accessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/lib/Method/Generate/Accessor.pm?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/lib/Method/Generate/Accessor.pm (original)
+++ trunk/libmoo-perl/lib/Method/Generate/Accessor.pm Wed Jun 15 21:27:59 2011
@@ -336,9 +336,33 @@
   my ($self, $me, $name, $spec, $value) = @_;
   my $name_str = perlstring $name;
   my $simple = "${me}->{${name_str}} = ${value}";
+
   if ($spec->{weak_ref}) {
     require Scalar::Util;
-    "Scalar::Util::weaken(${simple})";
+
+    # Perl < 5.8.3 can't weaken refs to readonly vars
+    # (e.g. string constants). This *can* be solved by:
+    #
+    #Internals::SetReadWrite($foo);
+    #Scalar::Util::weaken ($foo);
+    #Internals::SetReadOnly($foo);
+    #
+    # but requires XS and is just too damn crazy
+    # so simply throw a better exception
+    Moo::_Utils::lt_5_8_3() ? <<"EOC" : "Scalar::Util::weaken(${simple})";
+
+      eval { Scalar::Util::weaken($simple); 1 } or do {
+        if( \$@ =~ /Modification of a read-only value attempted/) {
+          require Carp;
+          Carp::croak( sprintf (
+            'Reference to readonly value in "%s" can not be weakened on Perl < 5.8.3',
+            $name_str,
+          ) );
+        } else {
+          die \$@;
+        }
+      };
+EOC
   } else {
     $simple;
   }

Modified: trunk/libmoo-perl/lib/Moo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/lib/Moo.pm?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/lib/Moo.pm (original)
+++ trunk/libmoo-perl/lib/Moo.pm Wed Jun 15 21:27:59 2011
@@ -3,7 +3,7 @@
 use strictures 1;
 use Moo::_Utils;
 
-our $VERSION = '0.009007'; # 0.9.7
+our $VERSION = '0.009008'; # 0.9.8
 $VERSION = eval $VERSION;
 
 our %MAKERS;

Modified: trunk/libmoo-perl/lib/Moo/_Utils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/lib/Moo/_Utils.pm?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/lib/Moo/_Utils.pm (original)
+++ trunk/libmoo-perl/lib/Moo/_Utils.pm Wed Jun 15 21:27:59 2011
@@ -2,6 +2,13 @@
 
 sub _getglob { \*{$_[0]} }
 sub _getstash { \%{"$_[0]::"} }
+
+BEGIN {
+  *lt_5_8_3 = $] < 5.008003
+    ? sub () { 1 }
+    : sub () { 0 }
+  ;
+}
 
 use strictures 1;
 use base qw(Exporter);
@@ -20,6 +27,8 @@
 }
 
 our %MAYBE_LOADED;
+
+# _load_module is inlined in Role::Tiny - make sure to copy if you update it.
 
 sub _load_module {
   (my $proto = $_[0]) =~ s/::/\//g;

Modified: trunk/libmoo-perl/lib/Role/Tiny.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/lib/Role/Tiny.pm?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/lib/Role/Tiny.pm (original)
+++ trunk/libmoo-perl/lib/Role/Tiny.pm Wed Jun 15 21:27:59 2011
@@ -1,6 +1,7 @@
 package Role::Tiny;
 
 sub _getglob { \*{$_[0]} }
+sub _getstash { \%{"$_[0]::"} }
 
 use strict;
 use warnings FATAL => 'all';
@@ -9,9 +10,14 @@
 our %APPLIED_TO;
 our %COMPOSED;
 
+# inlined from Moo::_Utils - update that first.
+
 sub _load_module {
-  return 1 if $_[0]->can('can');
   (my $proto = $_[0]) =~ s/::/\//g;
+  return 1 if $INC{"${proto}.pm"};
+  # can't just ->can('can') because a sub-package Foo::Bar::Baz
+  # creates a 'Baz::' key in Foo::Bar's symbol table
+  return 1 if grep !/::$/, keys %{_getstash($_[0])||{}};
   require "${proto}.pm";
   return 1;
 }

Modified: trunk/libmoo-perl/lib/Sub/Quote.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/lib/Sub/Quote.pm?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/lib/Sub/Quote.pm (original)
+++ trunk/libmoo-perl/lib/Sub/Quote.pm Wed Jun 15 21:27:59 2011
@@ -173,7 +173,7 @@
 
 =head2 quote_sub
 
- my $coderef = quote_sub 'Foo:bar', q{ print $x++ . "\n" }, { '$x' => \0 };
+ my $coderef = quote_sub 'Foo::bar', q{ print $x++ . "\n" }, { '$x' => \0 };
 
 Arguments: ?$name, $code, ?\%captures, ?\%options
 

Modified: trunk/libmoo-perl/maint/Makefile.PL.include
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/maint/Makefile.PL.include?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/maint/Makefile.PL.include (original)
+++ trunk/libmoo-perl/maint/Makefile.PL.include Wed Jun 15 21:27:59 2011
@@ -1,3 +1,4 @@
+use lib 'distar/lib';
 use Distar;
 
 author 'mst - Matt S. Trout (cpan:MSTROUT) <mst at shadowcat.co.uk>';

Modified: trunk/libmoo-perl/t/accessor-weaken.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/t/accessor-weaken.t?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/t/accessor-weaken.t (original)
+++ trunk/libmoo-perl/t/accessor-weaken.t Wed Jun 15 21:27:59 2011
@@ -9,11 +9,29 @@
   has one => (is => 'ro', weak_ref => 1);
 }
 
-my $ref = \'yay';
+my $ref = {};
+my $foo = Foo->new(one => $ref);
+is($foo->one, $ref, 'value present');
+ok(Scalar::Util::isweak($foo->{one}), 'value weakened');
+undef $ref;
+ok (!defined $foo->{one}, 'weak value gone');
 
-my $foo = Foo->new(one => $ref);
+# test readonly SVs
+sub mk_ref { \ 'yay' };
+my $foo_ro = eval { Foo->new(one => mk_ref()) };
+if ($] < 5.008003) {
+  like(
+    $@,
+    qr/\QReference to readonly value in "one" can not be weakened on Perl < 5.8.3/,
+    'Expected exception thrown on old perls'
+  );
+}
+else {
+  is(${$foo_ro->one},'yay', 'value present');
+  ok(Scalar::Util::isweak($foo_ro->{one}), 'value weakened');
 
-is(${$foo->one},'yay', 'value present');
-ok(Scalar::Util::isweak($foo->{one}), 'value weakened');
+  { no warnings 'redefine'; *mk_ref = sub {} }
+  ok (!defined $foo_ro->{one}, 'optree reaped, ro static value gone');
+}
 
 done_testing;

Modified: trunk/libmoo-perl/t/load_module.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/t/load_module.t?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/t/load_module.t (original)
+++ trunk/libmoo-perl/t/load_module.t Wed Jun 15 21:27:59 2011
@@ -1,6 +1,10 @@
+# this test is replicated to t/load_module_role_tiny.t for Role::Tiny
+
+# work around RT#67692
+use Moo::_Utils;
 use strictures 1;
+
 use Test::More;
-use Moo::_Utils;
 
 local @INC = (sub {
   return unless $_[1] eq 'Foo/Bar.pm';

Modified: trunk/libmoo-perl/t/sub-quote.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libmoo-perl/t/sub-quote.t?rev=75805&op=diff
==============================================================================
--- trunk/libmoo-perl/t/sub-quote.t (original)
+++ trunk/libmoo-perl/t/sub-quote.t Wed Jun 15 21:27:59 2011
@@ -21,7 +21,7 @@
 my $u_one = unquote_sub $one;
 
 is_deeply(
-  [ keys %EVALED ], [ qw(one two) ],
+  [ sort keys %EVALED ], [ qw(one two) ],
   'Both subs evaled'
 );
 




More information about the Pkg-perl-cvs-commits mailing list