Subject: | unpacking second archive fails after a problem in first |
If I remove first archive, problems do not appear.
Tested latest versions of Archive::Extract and Archive::Tar.
Strawberry perl 5.14.0.
Test program attached.
Output:
No such file in archive: 'mmds-1.902/doc/mmds-1.902/doc/intro/demo.pdf' at C:/strawberry514/perl/site/lib/Archive/Extract.pm line 897.
Could not find file 'mmds-1.902/doc/intro/demo.pdf' in memory. at C:/strawberry514/perl/site/lib/Archive/Extract.pm line 897.
Making hard link from 'mmds-1.902/doc/intro/demo.pdf' to 'D:\1\t1\mmds-1.902\doc\demo.pdf' failed at C:/strawberry514/perl/site/lib/Archive/Extract.pm line 897.
Unable to read 'D:\1\mmds-1.902.tar.gz': Making hard link from 'mmds-1.902/doc/intro/demo.pdf' to 'D:\1\t1\mmds-1.902\doc\demo.pdf' failed at t.pl line 18.
No '/bin/tar' program found at t.pl line 18.
Extract failed due to errors at t.pl line 18.
Failed to extract 'mmds-1.902.tar.gz': at t.pl line 21.
No such file in archive: 'Business-Stripe-0.05/Stripe.pm' at C:/strawberry514/perl/site/lib/Archive/Extract.pm line 897.
Could not find file 'Stripe.pm' in memory. at C:/strawberry514/perl/site/lib/Archive/Extract.pm line 897.
Making symbolic link 'D:\1\t1\Business-Stripe-0.05\README.pod' to 'Stripe.pm' failed at C:/strawberry514/perl/site/lib/Archive/Extract.pm line 897.
Unable to read 'D:\1\Business-Stripe-0.05.tar.gz': Making symbolic link 'D:\1\t1\Business-Stripe-0.05\README.pod' to 'Stripe.pm' failed at t.pl line 18.
No '/bin/tar' program found at t.pl line 18.
Extract failed due to errors at t.pl line 18.
Failed to extract 'Business-Stripe-0.05.tar.gz': at t.pl line 21.
--
Alexandr Ciornii, http://chorny.net
Subject: | t.pl |
use 5.12.0;
use warnings;
use Archive::Extract ();
my @list = (
'mmds-1.902.tar.gz', #https://cpan.metacpan.org/authors/id/J/JV/JV/mmds-1.902.tar.gz
'Business-Stripe-0.05.tar.gz', #https://cpan.metacpan.org/authors/id/P/PH/PHAM/Business-Stripe-0.05.tar.gz
);
mkdir 't1';
foreach my $archive (@list) {
#reduced code from CPAN::Mini::Visit
$Archive::Extract::PREFER_BIN = 0;
$Archive::Extract::WARN = 1;
my $extract = Archive::Extract->new( archive => $archive );
my $ok = 0;
$ok = eval {
$extract->extract( to => 't1/' ); #must not be ./
};
if ( $@ or not $ok ) {
warn("Failed to extract '$archive': $@");
next;
}
}