Re: [Module::Build] win32 install problem
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <ke...@ma...> - 2006-05-16 20:16:47
|
On May 16, 2006, at 7:40 AM, demerphq wrote: > Im pretty sure that the lines > > my ($name, $path) = File::Basename::fileparse($pods->{$pod}, > qr{\.(?:pm|plx?|pod)$}); > my @dirs = File::Spec->splitdir( File::Spec->canonpath( $path ) ); > > are wrong. FS->splitdir() splits a directory specification NOT a path. > If you use splitdir on a path that includes a volume specification > then obviously it wont work out (actually it will return the volume as > tho it was a directory) > > I think you need something like: > > my $spec=File::Spec->canonpath( $pods->{$pod} ); > my ($vol,$path,$file)= File::Spec->splitpath($spec); > my ($name) = File::Basename::fileparse($file,qr{\.(?:pm|plx?|pod)$}); > my @dirs = File::Spec->splitdir( $path ); > pop( @dirs ) if $dirs[-1] eq File::Spec->curdir; Okay, does this patch rectify the situation? -Ken === lib/Module/Build/Base.pm ================================================================== --- lib/Module/Build/Base.pm (revision 1905) +++ lib/Module/Build/Base.pm (local) @@ -2523,7 +2523,8 @@ my ($name, $path) = File::Basename::fileparse($pods->{$pod}, qr{\.(?:pm|plx?|pod)$}); - my @dirs = File::Spec->splitdir( File::Spec->canonpath( $path ) ); + my ($vol, $dirs) = File::Spec->splitpath($path, 1); + my @dirs = File::Spec->splitdir( File::Spec->canonpath( $dirs ) ); pop( @dirs ) if $dirs[-1] eq File::Spec->curdir; my $fulldir = File::Spec->catfile($htmldir, @rootdirs, @dirs); |