[perl-Module-Pluggable/f19] Do not ignore single-letter-named packages

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

 



commit ee50dac10f6a320e6f5ad2ee004e45e73d882e98
Author: Petr Písař <ppisar@xxxxxxxxxx>
Date:   Mon Jan 6 09:05:31 2014 +0100

    Do not ignore single-letter-named packages

 ...ble-4.8-Allow-single-letter-package-names.patch |   94 ++++++++++++++++++++
 perl-Module-Pluggable.spec                         |    9 ++-
 2 files changed, 102 insertions(+), 1 deletions(-)
---
diff --git a/Module-Pluggable-4.8-Allow-single-letter-package-names.patch b/Module-Pluggable-4.8-Allow-single-letter-package-names.patch
new file mode 100644
index 0000000..5cb7615
--- /dev/null
+++ b/Module-Pluggable-4.8-Allow-single-letter-package-names.patch
@@ -0,0 +1,94 @@
+From 7872bc27ac7f828a6b53d00717abdf83f2d1866d Mon Sep 17 00:00:00 2001
+From: Simon Wistow <simon@xxxxxxxxxx>
+Date: Tue, 22 Oct 2013 09:32:27 -0700
+Subject: [PATCH] Allow single letter package names
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař <ppisar@xxxxxxxxxx>
+---
+ lib/Module/Pluggable/Object.pm |  2 +-
+ t/25single_letter_package.t    | 42 ++++++++++++++++++++++++++++++++++++++++++
+ t/lib/M/X.pm                   |  7 +++++++
+ 3 files changed, 50 insertions(+), 1 deletion(-)
+ create mode 100755 t/25single_letter_package.t
+ create mode 100644 t/lib/M/X.pm
+
+diff --git a/lib/Module/Pluggable/Object.pm b/lib/Module/Pluggable/Object.pm
+index 6f7a051..46240a8 100755
+--- a/lib/Module/Pluggable/Object.pm
++++ b/lib/Module/Pluggable/Object.pm
+@@ -234,7 +234,7 @@ sub search_paths {
+             }
+             my $plugin = join '::', $searchpath, @dirs, $name;
+ 
+-            next unless $plugin =~ m!(?:[a-z\d]+)[a-z\d]!i;
++            next unless $plugin =~ m!(?:[a-z\d]+)[a-z\d]*!i;
+ 
+             $self->handle_finding_plugin($plugin, \@plugins)
+         }
+diff --git a/t/25single_letter_package.t b/t/25single_letter_package.t
+new file mode 100755
+index 0000000..dd55fff
+--- /dev/null
++++ b/t/25single_letter_package.t
+@@ -0,0 +1,42 @@
++#!perl -w
++
++use strict;
++use FindBin;
++use lib (($FindBin::Bin."/lib")=~/^(.*)$/);
++use Test::More tests => 5;
++
++my $foo;
++ok($foo = M->new());
++
++my @plugins;
++my @expected = qw(M::X);
++ok(@plugins = sort $foo->plugins);
++
++
++
++is_deeply(\@plugins, \@expected, "is deeply");
++
++@plugins = ();
++
++ok(@plugins = sort M->plugins);
++
++
++
++
++is_deeply(\@plugins, \@expected, "is deeply class");
++
++
++
++package M;
++
++use strict;
++use Module::Pluggable search_path => "M";
++
++
++sub new {
++    my $class = shift;
++    return bless {}, $class;
++
++}
++1;
++
+diff --git a/t/lib/M/X.pm b/t/lib/M/X.pm
+new file mode 100644
+index 0000000..77f8f58
+--- /dev/null
++++ b/t/lib/M/X.pm
+@@ -0,0 +1,7 @@
++package M::X;
++
++use strict;
++
++sub new { return bless {}, $_[0]; }
++sub frobnitz {}
++1;
+-- 
+1.8.3.1
+
diff --git a/perl-Module-Pluggable.spec b/perl-Module-Pluggable.spec
index cf31f6b..e09296a 100644
--- a/perl-Module-Pluggable.spec
+++ b/perl-Module-Pluggable.spec
@@ -2,12 +2,15 @@ Name:           perl-Module-Pluggable
 # Epoch to compete with perl.spec
 Epoch:          1
 Version:        4.8
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Automatically give your module the ability to have plugins
 License:        GPL+ or Artistic
 Group:          Development/Libraries
 URL:            http://search.cpan.org/dist/Module-Pluggable/
 Source0:        http://www.cpan.org/authors/id/S/SI/SIMONW/Module-Pluggable-%{version}.tar.gz
+# Do not ignore single-letter-named packages, bug #1048703, CPAN RT#89680,
+# fixed in 5.0.
+Patch0:         Module-Pluggable-4.8-Allow-single-letter-package-names.patch
 BuildArch:      noarch
 BuildRequires:  perl
 BuildRequires:  perl(FindBin)
@@ -47,6 +50,7 @@ into class names. Optionally it instantiates those classes for you.
 
 %prep
 %setup -q -n Module-Pluggable-%{version}
+%patch0 -p1
 find -type f -exec chmod -x {} +
 
 %build
@@ -66,6 +70,9 @@ perl Build.PL installdirs=vendor
 %{_mandir}/man3/*
 
 %changelog
+* Mon Jan 06 2014 Petr Pisar <ppisar@xxxxxxxxxx> - 1:4.8-2
+- Do not ignore single-letter-named packages (bug #1048703)
+
 * Tue May 28 2013 Petr Pisar <ppisar@xxxxxxxxxx> - 1:4.8-1
 - 4.8 bump
 
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel





[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux