Permalink
Browse files

keep share_dir manipulations in unix file format as long as possible

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13668 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information...
1 parent 5b8168c commit 941881e0a20fa1ebc17e028634be49d289c40141 @xdg xdg committed Dec 17, 2009
Showing with 6 additions and 7 deletions.
  1. +4 −5 lib/Module/Build/Base.pm
  2. +2 −2 t/properties/share_dir.t
@@ -2756,14 +2756,14 @@ sub _find_share_dir_files {
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 @@ sub _share_dir_map {
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;
@@ -162,8 +162,8 @@ is_deeply( $mb->share_dir,
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"
);

0 comments on commit 941881e

Please sign in to comment.