Author: dagolden
Date: Thu Dec 17 07:00:27 2009
New Revision: 13668

Modified:
   Module-Build/trunk/lib/Module/Build/Base.pm
   Module-Build/trunk/t/properties/share_dir.t

Log:
keep share_dir manipulations in unix file format as long as possible

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 Thu Dec 17 07:00:27 2009
@@ -2756,14 +2756,14 @@
 
   my @file_map;
   if ( $share_dir->{dist} ) {
-    my $prefix = File::Spec->catdir( "dist", $self->dist_name );
+    my $prefix = "dist/".$self->dist_name;
     push @file_map, $self->_share_dir_map( $prefix, $share_dir->{dist} );
   }
 
   if ( $share_dir->{module} ) {
     for my $mod ( keys %{ $share_dir->{module} } ) {
       (my $altmod = $mod) =~ s{::}{-}g;
-      my $prefix = File::Spec->catdir("module", $altmod);
+      my $prefix = "module/$altmod";
       push @file_map, $self->_share_dir_map($prefix, 
$share_dir->{module}{$mod});
     }
   }
@@ -2776,9 +2776,8 @@
   my %files;
   for my $dir ( @$list ) {
     for my $f ( @{ $self->rscan_dir( $dir, sub {-f} )} ) {
-      $files{File::Spec->canonpath($f)} = File::Spec->catfile(
-        $prefix, File::Spec->abs2rel( $f, $dir )
-      );
+      $f =~ s{\A.*\Q$dir\E/}{};
+      $files{"$dir/$f"} = "$prefix/$f";
     }
   }
   return %files;

Modified: Module-Build/trunk/t/properties/share_dir.t
==============================================================================
--- Module-Build/trunk/t/properties/share_dir.t (original)
+++ Module-Build/trunk/t/properties/share_dir.t Thu Dec 17 07:00:27 2009
@@ -162,8 +162,8 @@
 
 is_deeply( $mb->_find_share_dir_files,
   {
-    catfile(qw/share foo.txt/) => catfile(qw/dist Simple-Share foo.txt/),
-    catfile(qw/other share bar.txt/) => catfile(qw/module Simple-Share 
bar.txt/),
+    "share/foo.txt" => "dist/Simple-Share/foo.txt",
+    "other/share/bar.txt" => "module/Simple-Share/bar.txt",
   },
   "share_dir filemap for copying to lib complete"
 );

Reply via email to