r5050 - in
/packages/libmodule-pluggable-perl/branches/upstream/current:
Changes META.yml 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:13:07 UTC 2007
Author: gregoa-guest
Date: Fri Apr 13 19:13:07 2007
New Revision: 5050
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=5050
Log:
[svn-upgrade] Integrating new upstream version, libmodule-pluggable-perl (3.6)
Modified:
packages/libmodule-pluggable-perl/branches/upstream/current/Changes
packages/libmodule-pluggable-perl/branches/upstream/current/META.yml
packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable.pm
packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable/Object.pm
packages/libmodule-pluggable-perl/branches/upstream/current/t/20dodgy_files.t
Modified: packages/libmodule-pluggable-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/branches/upstream/current/Changes?rev=5050&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/branches/upstream/current/Changes (original)
+++ packages/libmodule-pluggable-perl/branches/upstream/current/Changes Fri Apr 13 19:13:07 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/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/branches/upstream/current/META.yml?rev=5050&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/branches/upstream/current/META.yml (original)
+++ packages/libmodule-pluggable-perl/branches/upstream/current/META.yml Fri Apr 13 19:13:07 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/branches/upstream/current/lib/Module/Pluggable.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable.pm?rev=5050&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable.pm (original)
+++ packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable.pm Fri Apr 13 19:13:07 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/branches/upstream/current/lib/Module/Pluggable/Object.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable/Object.pm?rev=5050&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable/Object.pm (original)
+++ packages/libmodule-pluggable-perl/branches/upstream/current/lib/Module/Pluggable/Object.pm Fri Apr 13 19:13:07 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/branches/upstream/current/t/20dodgy_files.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libmodule-pluggable-perl/branches/upstream/current/t/20dodgy_files.t?rev=5050&op=diff
==============================================================================
--- packages/libmodule-pluggable-perl/branches/upstream/current/t/20dodgy_files.t (original)
+++ packages/libmodule-pluggable-perl/branches/upstream/current/t/20dodgy_files.t Fri Apr 13 19:13:07 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