ERROR: Can't extract files from... PPM fails to extract .tgz

Posted by taints69 on 2008-10-18 11:50
Forums: PPM | OS: Windows XP Pro

Does anyone know how to fix this problem with ppm on windows?

grahams
ActiveState Staff
Thu, 2008-10-30 17:01

It depends on the exact message you are getting, and when you get it.

For instance, if you happen to be using 5.8, there are several modules in the old default repo that are known to be corrupted, and they will give you an error message because they can't be de-compressed. (The fix for this is to switch to the new repository, by the way. It's currently a manual action, but within a few days the old repos will be replaced.)

roly | Wed, 2012-04-25 01:38

We had this problem recently. I had to rebuild my pc, re-installed 5.8.8, and then got this message for whatever package I attempted to install using ppm. I removed installed 5.14 and still got this message. A colleague of mine who had not changed his setup at all also got this message. He came up with a solution though.

This is what he wrote

A possible solution is to edit the file C:/Perl/lib/ActivePerl/PPM/Web.pm (take a copy of the original first) and comment out this line

##$ua->default_header("Accept-Encoding" => "gzip, deflate");

What’s actually going on is that when ppm requests a download from the repository it uses HTTP and sets the “Accept-Encoding” header as above to indicate that it can accept content in gzip format. Accordingly, the ppm repository responds with a download in this format, however the perl client code does not handle this correctly, i.e. does not unzip it. Haven’t figured out why this is but it is definitely not doing it right. Confusingly, because many of the downloads are already gzipped tarfile what we end up with is a “double gzipped” tar file, for example

$ cat Archive-Extract-0.34.tgz | tar -tf -
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now
$ cat Archive-Extract-0.34.tgz | gunzip | tar -tf -
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now
$ cat Archive-Extract-0.34.tgz | gunzip | gunzip | tar -tf -
Archive-Extract-0.34.ppd
blib/
blib/lib/
blib/lib/Archive/
blib/lib/Archive/Extract.pm
$

HTH.