From: Rafael Kitover Date: Wed, 30 Dec 2009 17:30:58 +0000 (+0000) Subject: bump File::Path dep, fixup redefined warning handler X-Git-Tag: 0.04999_13~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=502b65d4d60d2a985dd285c9101415f47123377a;p=dbsrgits%2FDBIx-Class-Schema-Loader.git bump File::Path dep, fixup redefined warning handler --- diff --git a/Makefile.PL b/Makefile.PL index 42c232b..947f9c7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,7 +6,7 @@ all_from 'lib/DBIx/Class/Schema/Loader.pm'; test_requires 'Test::More' => '0.94'; test_requires 'DBI' => '1.56'; test_requires 'DBD::SQLite' => '1.12'; -test_requires 'File::Path' => 0; +test_requires 'File::Path' => '2.07'; test_requires 'IPC::Open3' => 0; test_requires 'Test::Exception'; diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 516a402..5b11376 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -518,8 +518,10 @@ sub _load_external { if ($self->dynamic) { # load the class too # kill redefined warnings + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; local $SIG{__WARN__} = sub { - warn @_ unless $_[0] =~ /^Subroutine \S+ redefined/; + $warn_handler->(@_) + unless $_[0] =~ /^Subroutine \S+ redefined/; }; do $real_inc_path; die $@ if $@; @@ -545,8 +547,10 @@ been used by an 0.04006 version of the Loader. new name of the Result. EOF # kill redefined warnings + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; local $SIG{__WARN__} = sub { - warn @_ unless $_[0] =~ /^Subroutine \S+ redefined/; + $warn_handler->(@_) + unless $_[0] =~ /^Subroutine \S+ redefined/; }; my $code = do { local ($/, @ARGV) = (undef, $old_real_inc_path); <> @@ -736,10 +740,11 @@ sub _reload_class { delete $INC{ $class_path }; # kill redefined warnings + my $warn_handler = $SIG{__WARN__} || sub { warn @_ }; local $SIG{__WARN__} = sub { - warn @_ unless $_[0] =~ /^Subroutine \S+ redefined/; + $warn_handler->(@_) + unless $_[0] =~ /^Subroutine \S+ redefined/; }; - eval "require $class;"; }