Merge 'current' into 'deprecate_CDA'
Rafael Kitover [Wed, 30 Dec 2009 21:01:16 +0000 (21:01 +0000)]
r22312@hlagh (orig r8185):  caelum | 2009-12-30 12:30:58 -0500
bump File::Path dep, fixup redefined warning handler
r22313@hlagh (orig r8186):  caelum | 2009-12-30 15:58:06 -0500
fix tests

1  2 
lib/DBIx/Class/Schema/Loader/Base.pm

@@@ -417,7 -417,7 +417,7 @@@ EO
              my ($v) = $real_ver =~ /([1-9])/;
              $v = "v$v";
  
-             last if $v eq CURRENT_V;
+             last if $v eq CURRENT_V || $real_ver =~ /^0\.04999/;
  
              if (not %{ $self->naming }) {
                  warn <<"EOF" unless $ENV{SCHEMA_LOADER_BACKCOMPAT};
@@@ -453,7 -453,7 +453,7 @@@ sub _find_file_in_inc 
          my $fullpath = File::Spec->catfile($prefix, $file);
          return $fullpath if -f $fullpath
              and Cwd::abs_path($fullpath) ne
 -                Cwd::abs_path(File::Spec->catfile($self->dump_directory, $file)) || '';
 +               (Cwd::abs_path(File::Spec->catfile($self->dump_directory, $file)) || '');
      }
  
      return;
@@@ -518,8 -518,10 +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 +547,10 @@@ been used by an 0.04006 version of the 
  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 +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;";
  }