r5052 - in /packages/libmodule-pluggable-perl/trunk: Changes META.yml debian/changelog debian/control lib/Module/Pluggable.pm lib/Module/Pluggable/Object.pm t/20dodgy_files.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Apr 13 19:14:50 UTC 2007


Author: gregoa-guest
Date: Fri Apr 13 19:14:50 2007
New Revision: 5052

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5052
Log:
* New upstream release.

Modified:
    packages/libmodule-pluggable-perl/trunk/Changes
    packages/libmodule-pluggable-perl/trunk/META.yml
    packages/libmodule-pluggable-perl/trunk/debian/changelog
    packages/libmodule-pluggable-perl/trunk/debian/control
    packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable.pm
    packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable/Object.pm
    packages/libmodule-pluggable-perl/trunk/t/20dodgy_files.t

Modified: packages/libmodule-pluggable-perl/trunk/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/Changes?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/Changes (original)
+++ packages/libmodule-pluggable-perl/trunk/Changes Fri Apr 13 19:14:50 2007
@@ -1,3 +1,11 @@
+2007-04-07 - 3.6
+    Include blead perl patch from Craig Berry that gives better 
+    Module::Pluggable::Object::search_paths portability as 
+    prompted by VMS test failures.
+
+2007-01-29 - 3.5
+    Patch from Audrey Tang to prevent clobbering of $@
+
 2006-11-27 - 3.4
     Make sure we don't fail taint checking when other 
     Module::Pluggable::* modules are installed.

Modified: packages/libmodule-pluggable-perl/trunk/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/META.yml?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/META.yml (original)
+++ packages/libmodule-pluggable-perl/trunk/META.yml Fri Apr 13 19:14:50 2007
@@ -1,6 +1,6 @@
 ---
 name: Module-Pluggable
-version: 3.4
+version: 3.6
 author:
   - 'Simon Wistow <simon at thegestalt.org>'
 abstract: automatically give your module the ability to have plugins
@@ -17,9 +17,10 @@
     version: 0.3
   Module::Pluggable:
     file: lib/Module/Pluggable.pm
-    version: 3.4
+    version: 3.6
   Module::Pluggable::Object:
     file: lib/Module/Pluggable/Object.pm
+    version: 3.6
 generated_by: Module::Build version 0.2801
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: packages/libmodule-pluggable-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/debian/changelog?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/debian/changelog (original)
+++ packages/libmodule-pluggable-perl/trunk/debian/changelog Fri Apr 13 19:14:50 2007
@@ -1,3 +1,9 @@
+libmodule-pluggable-perl (3.6-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Fri, 13 Apr 2007 21:13:42 +0200
+
 libmodule-pluggable-perl (3.4-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/libmodule-pluggable-perl/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/debian/control?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/debian/control (original)
+++ packages/libmodule-pluggable-perl/trunk/debian/control Fri Apr 13 19:14:50 2007
@@ -2,7 +2,7 @@
 Section: perl
 Priority: optional
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Niko Tyni <ntyni at iki.fi>, Krzysztof Krzyzaniak (eloy) <eloy at debian.org>
+Uploaders: Niko Tyni <ntyni at iki.fi>, Krzysztof Krzyzaniak (eloy) <eloy at debian.org>, gregor herrmann <gregor+debian at comodo.priv.at>
 Build-Depends: debhelper (>= 5)
 Build-Depends-Indep: perl (>= 5.6.0-16), perl-modules
 Standards-Version: 3.7.2

Modified: packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable.pm?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable.pm (original)
+++ packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable.pm Fri Apr 13 19:14:50 2007
@@ -9,7 +9,7 @@
 # Peter Gibbons: I wouldn't say I've been missing it, Bob! 
 
 
-$VERSION = '3.4';
+$VERSION = '3.6';
 
 sub import {
     my $class        = shift;

Modified: packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable/Object.pm?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable/Object.pm (original)
+++ packages/libmodule-pluggable-perl/trunk/lib/Module/Pluggable/Object.pm Fri Apr 13 19:14:50 2007
@@ -3,10 +3,14 @@
 use strict;
 use File::Find ();
 use File::Basename;
-use File::Spec::Functions qw(splitdir catdir abs2rel);
+use File::Spec::Functions qw(splitdir catdir curdir catfile abs2rel);
 use Carp qw(croak carp);
 use Devel::InnerPackage;
 use Data::Dumper;
+use vars qw($VERSION);
+
+$VERSION = '3.6';
+
 
 sub new {
     my $class = shift;
@@ -145,21 +149,52 @@
             # untaint the file; accept .pm only
             next unless ($file) = ($file =~ /(.*$file_regex)$/); 
             # parse the file to get the name
-            my ($name, $directory) = fileparse($file, $file_regex);
+            my ($name, $directory, $suffix) = fileparse($file, $file_regex);
 
             $directory = abs2rel($directory, $sp);
+
+            # If we have a mixed-case package name, assume case has been preserved
+            # correctly.  Otherwise, root through the file to locate the case-preserved
+            # version of the package name.
+            my @pkg_dirs = ();
+            if ( $name eq lc($name) || $name eq uc($name) ) {
+                my $pkg_file = catfile($sp, $directory, "$name$suffix");
+                open PKGFILE, "<$pkg_file" or die "search_paths: Can't open $pkg_file: $!";
+                my $in_pod = 0;
+                while ( my $line = <PKGFILE> ) {
+                    $in_pod = 1 if $line =~ m/^=\w/;
+                    $in_pod = 0 if $line =~ /^=cut/;
+                    next if ($in_pod || $line =~ /^=cut/);  # skip pod text
+                    next if $line =~ /^\s*#/;               # and comments
+                    if ( $line =~ m/^\s*package\s+(.*::)?($name)\s*;/i ) {
+                        @pkg_dirs = split /::/, $1;
+                        $name = $2;
+                        last;
+                    }
+                }
+                close PKGFILE;
+            }
+
             # then create the class name in a cross platform way
             $directory =~ s/^[a-z]://i if($^O =~ /MSWin32|dos/);       # remove volume
+            my @dirs = ();
             if ($directory) {
                 ($directory) = ($directory =~ /(.*)/);
+                @dirs = grep(length($_), splitdir($directory)) 
+                    unless $directory eq curdir();
+                for my $d (reverse @dirs) {
+                    my $pkg_dir = pop @pkg_dirs; 
+                    last unless defined $pkg_dir;
+                    $d =~ s/\Q$pkg_dir\E/$pkg_dir/i;  # Correct case
+                }
             } else {
                 $directory = "";
             }
-            my $plugin = join "::", splitdir catdir($searchpath, $directory, $name);
+            my $plugin = join '::', $searchpath, @dirs, $name;
 
             next unless $plugin =~ m!(?:[a-z\d]+)[a-z\d]!i;
 
-            my $err = eval { $self->handle_finding_plugin($plugin) };
+            my $err = $self->handle_finding_plugin($plugin);
             carp "Couldn't require $plugin : $err" if $err;
              
             push @plugins, $plugin;
@@ -215,7 +250,7 @@
 
 
     foreach my $plugin (Devel::InnerPackage::list_packages($path)) {
-        my $err = eval { $self->handle_finding_plugin($plugin) };
+        my $err = $self->handle_finding_plugin($plugin);
         #next if $err;
         #next unless $INC{$plugin};
         push @plugins, $plugin;
@@ -228,6 +263,7 @@
 sub _require {
     my $self = shift;
     my $pack = shift;
+    local $@;
     eval "CORE::require $pack";
     return $@;
 }

Modified: packages/libmodule-pluggable-perl/trunk/t/20dodgy_files.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/trunk/t/20dodgy_files.t?rev=5052&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/trunk/t/20dodgy_files.t (original)
+++ packages/libmodule-pluggable-perl/trunk/t/20dodgy_files.t Fri Apr 13 19:14:50 2007
@@ -1,4 +1,11 @@
 #!perl -w
+
+BEGIN {
+    if ($^O eq 'VMS') {
+        print "1..0 # Skip: can't handle misspelled plugin names\n";
+        exit;
+    }
+}
 
 use strict;
 use FindBin;




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