Skip Menu |

This queue is for tickets about the Archive-Extract CPAN distribution.

Report information
The Basics
Id: 52639
Status: open
Priority: 0/
Queue: Archive-Extract

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.34
  • 0.36
Fixed in: (no value)



Subject: extract() a little confused by a tarball with nothing in it
I discovered on BackPAN a tarball that is non-empty but has no files nor directories in it. http://backpan.perl.org/authors/id/C/CN/CNANDOR/Bundle-Slash-2.12.tar.gz It is a valid tarball, it just has nothing in it. Archive::Extract is a little confused by it. Running it through the following: use Archive::Extract; my $file = shift; my $prefer = shift; $Archive::Extract::PREFER_BIN = $prefer; $ae = Archive::Extract->new( archive => shift ); $ae->extract( to => "/tmp" ) or die $ae->error; print $ae->extract_path With PREFER_BIN true, extract() succeeds, but there is no extract_path(). /var/local/backpan/authors/id/C/CN/CNANDOR/Bundle-Slash-2.11.tar.gz Use of uninitialized value in print at -e line 1. With PREFER_BIN false, extract() fails, but there's no reason and there's an internal warning. Use of uninitialized value in -d at /usr/local/lib/perl5/5.10.1/Archive/Extract.pm line 860. Unable to extract '/var/local/backpan/authors/id/C/CN/CNANDOR/Bundle-Slash-2.11.tar.gz': at -e line 1 Use of uninitialized value in print at -e line 1. Its an open question as to whether extract() should succeed. Technically, yes it should succeed because its a valid tarball, but it introduces a weird condition (successful extract() but no extract_path()) that a user has to check for.
For clarity, this is the empty tarball: http://backpan.perl.org/authors/id/C/CN/CNANDOR/Bundle-Slash-2.11.tar.gz I'm not sure what the right solution is here either to be honest; in most cases you'd expect something to be in a tarball when you fetch it (why tar it up otherwise?). Any suggestions are welcome at this point on how to deal with such a situation.