Author: dagolden
Date: Sat Jan 17 08:51:40 2009
New Revision: 12454

Modified:
   Module-Build/trunk/   (props changed)
   Module-Build/trunk/lib/Module/Build/Base.pm
   Module-Build/trunk/t/files.t

Log:
flatten absolute paths on copy_if_modified (fixes bug from files.t changes)


Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Sat Jan 17 08:51:40 2009
@@ -4398,12 +4398,15 @@
             );
   $args{verbose} = !$self->quiet
     unless exists $args{verbose};
-  
+
   my $file = $args{from};
   unless (defined $file and length $file) {
     die "No 'from' parameter given to copy_if_modified";
   }
-  
+ 
+  # makes no sense to replicate an absolute path, so assume flatten 
+  $args{flatten} = 1 if File::Spec->file_name_is_absolute( $file );
+
   my $to_path;
   if (defined $args{to} and length $args{to}) {
     $to_path = $args{to};

Modified: Module-Build/trunk/t/files.t
==============================================================================
--- Module-Build/trunk/t/files.t        (original)
+++ Module-Build/trunk/t/files.t        Sat Jan 17 08:51:40 2009
@@ -2,7 +2,7 @@
 
 use strict;
 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
-use MBTest tests => 8;
+use MBTest tests => 6;
 
 use_ok 'Module::Build';
 ensure_blib('Module::Build');
@@ -17,7 +17,6 @@
 $dist->chdir_in;
 
 my $mb = Module::Build->new_from_context;
-my @files;
 
 {
   # Make sure copy_if_modified() can handle spaces in filenames

Reply via email to