--- "Jos I. Boumans" <[EMAIL PROTECTED]> wrote:
>
> On May 4, 2005, at 10:08 AM, DH wrote:
>
> > t/02_methods....# No long filename support - long filename extraction
> > disabled
> > t/02_methods....ok 1/0Could not open file
> > 'C:\Perl\.cpanplus\5.8.4\build\Archive-Tar-1.24\t\C:
> > \Perl\.cpanplus\5.8.4\build\Archive-Tar-1.24
> > \t\src\short\3312': Invalid argument at t/02_methods.t line 693
> >
> > t/02_methods....NOK 134# Failed test (t/02_methods.t at line 693)
> >
> > t/02_methods....NOK 135# Failed test (t/02_methods.t at line 695)
> > Could not open file
> > 'C:\Perl\.cpanplus\5.8.4\build\Archive-Tar-1.24\t\C:
> > \Perl\.cpanplus\5.8.4\build\Archive-Tar-1.24\t\src\short\3312':
> > In
> > valid argument at t/02_methods.t line 693
>
> This is either a very weird bug with file::spec, or a logic error in
> the tests i can't quite tackle... here's the relevant code snippet:
>
> ### warn if we are going to skip long file names
> $TOO_LONG ? diag("No long filename support - long filename
> extraction disabled")
> : ( push @EXPECT_NORMAL, [ [], $LONG_FILE,
> qr/^hello\s*$/] ) ;
>
> my @ROOT = grep { length } 'src', $TOO_LONG ? 'short' :
> 'long';
>
> [....]
>
> ### alternate extract path tests
> ### to abs and rel paths
> { for my $outpath ( File::Spec->catdir( @ROOT ),
> File::Spec->rel2abs(
> File::Spec->catdir( @ROOT )
> )
> ) {
>
> my $outfile = File::Spec->catfile( $outpath, $$ );
>
> ok( $tar->extract_file( $file->full_path, $outfile ),
> " Extracted file '$path' to $outfile" );
> ok( -e $outfile," Extracted file '$outfile' exists" );
>
> rm( $outfile ) unless $NO_UNLINK;
> }
> }
>
> In short, @ROOT holds a list of directories relative to the t dir.
> once we run the test with the relative path, once iwth the absolute...
> and the 2nd one breaks with teh above error... i can't quite understand
> why that would happen... could you add some debug code on the relevant
> lines and see what's being attempted?
I've traced it down to sub _extract_file {
$extract_path (aka $alt) is
C:\Perl\.cpanplus\5.8.4\build\Archive-Tar-1.24\t\src\short\2308
and you're using File::Spec::Unix->splitpath( on it,
which doesn't know how to deal with it.
Checking the documentation for extract_file, it does say it wants a unix path,
but that doesn't seem fair to me :) replacing
File::Spec::Unix
with
File::Spec
seems to fix it.
I am PODMASTER
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail