Re: [Module::Build] win32 install problem
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <ra...@th...> - 2006-05-16 20:43:29
|
Ken Williams wrote: > > 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? I can now reproduce this using AS perl 5.6 on Windows. The failure is in ->_find_pods at the call to abs2rel() $files{$file} = File::Spec->abs2rel($file, $dir) if $self->contains_pod( $file ) Here are some values as they are passed in and their results: file => blib\lib dir => blib\lib result => C: file => blib\lib/Simple.pm dir => blib\lib result => C:Simple.pm file => blib\lib/Simple dir => blib\lib result => C:Simple file => blib\lib/Simple/AllPod.pod dir => blib\lib result => C:Simple\AllPod.pod file => blib\lib/Simple/NoPod.pm dir => blib\lib result => C:Simple\NoPod.pm file => blib\arch dir => blib\arch result => C: file => blib\lib dir => blib\lib result => C: This is a bug in the version of File::Spec supplied, I think. It still fails in the same way if I convert the paths to absolute paths before the above call to abs2rel. $file = File::Spec->rel2abs($file); $dir = File::Spec->rel2abs($dir); $files{$file} = File::Spec->abs2rel($file, $dir) if $self->contains_pod( $file ) With: file => C:\Downloads\Module-Build-0.28\t\_tmp\Simple\blib\lib\Simple.pm dir => C:\Downloads\Module-Build-0.28\t\_tmp\Simple\blib\lib result => C:Simple.pm Is there a workaround or do we require an update File::Spec ??? Randy. |