Skip Menu |

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

Report information
The Basics
Id: 119262
Status: resolved
Worked: 45 min
Priority: 0/
Queue: Archive-Tar

People
Owner: BINGOS [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc: pmqs [...] cpan.org
wosch [...] freebsd.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.20
Fixed in: 2.24



CC: wosch [...] freebsd.org, pmqs [...] cpan.org
Subject: Cannot deal with .tar.bz2 distributions created by pbzip2
Archive::Tar->extract_archive fails on (some) tarballs compressed with pbzip2, the parallel variant of bzip2. The error message looks like this: Read error on tarfile (missing data) 'testdir/test' at offset 1024 The problem was already discussed in this ticket in the IO-Compress queue: https://rt.cpan.org/Ticket/Display.html?id=77743 The proposed fix was to use MultiStream=>1 when constructing the IO::Uncompress::Bunzip2 object. I can confirm that this works; monkey-patching the Archive::Tar::_get_handle method like this works for me: no warnings 'redefine'; *Archive::Tar::_get_handle = sub { my($self, $file) = @_; no warnings 'once'; my $fh = IO::Uncompress::Bunzip2->new( $file, MultiStream => 1 ) || $self->_error( qq[Could not read '$file': ] . $IO::Uncompress::Bunzip2::Bunzip2Error ); $fh; }; In my experiments MultiStream=>1 works also for tarballs compressed with traditional bzip2.
On Fri Dec 16 02:18:46 2016, SREZIC wrote: Show quoted text
> Archive::Tar->extract_archive fails on (some) tarballs compressed with > pbzip2, the parallel variant of bzip2. The error message looks like > this: > > Read error on tarfile (missing data) 'testdir/test' at offset 1024 > > The problem was already discussed in this ticket in the IO-Compress > queue: > https://rt.cpan.org/Ticket/Display.html?id=77743 > The proposed fix was to use MultiStream=>1 when constructing the > IO::Uncompress::Bunzip2 object. > I can confirm that this works; monkey-patching the > Archive::Tar::_get_handle method like this works for me: > > no warnings 'redefine'; > *Archive::Tar::_get_handle = sub { > my($self, $file) = @_; > no warnings 'once'; > my $fh = IO::Uncompress::Bunzip2->new( $file, MultiStream => 1 ) > || > $self->_error( qq[Could not read '$file': ] . > $IO::Uncompress::Bunzip2::Bunzip2Error > ); > $fh; > }; > > In my experiments MultiStream=>1 works also for tarballs compressed > with traditional bzip2.
Thanks. I applied this fix and released as 2.24.
RT-Send-CC: pmqs [...] cpan.org, wosch [...] freebsd.org
On 2017-05-12 08:39:45, BINGOS wrote: Show quoted text
> On Fri Dec 16 02:18:46 2016, SREZIC wrote:
> > Archive::Tar->extract_archive fails on (some) tarballs compressed with > > pbzip2, the parallel variant of bzip2. The error message looks like > > this: > > > > Read error on tarfile (missing data) 'testdir/test' at offset 1024 > > > > The problem was already discussed in this ticket in the IO-Compress > > queue: > > https://rt.cpan.org/Ticket/Display.html?id=77743 > > The proposed fix was to use MultiStream=>1 when constructing the > > IO::Uncompress::Bunzip2 object. > > I can confirm that this works; monkey-patching the > > Archive::Tar::_get_handle method like this works for me: > > > > no warnings 'redefine'; > > *Archive::Tar::_get_handle = sub { > > my($self, $file) = @_; > > no warnings 'once'; > > my $fh = IO::Uncompress::Bunzip2->new( $file, MultiStream => 1 ) > > || > > $self->_error( qq[Could not read '$file': ] . > > $IO::Uncompress::Bunzip2::Bunzip2Error > > ); > > $fh; > > }; > > > > In my experiments MultiStream=>1 works also for tarballs compressed > > with traditional bzip2.
> > Thanks. > > I applied this fix and released as 2.24.
Thanks, confirmed.