Skip Menu |

This queue is for tickets about the PAR CPAN distribution.

Report information
The Basics
Id: 30000
Status: stalled
Priority: 0/
Queue: PAR

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

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Make PAR able to use local zip tools if available
Right now the only platform-dependent prerequisite of PAR is Compress::Raw::Zlib, which is pulled in by IO::Compress::Zlib. For Bugzilla, I'd like to ship PAR::Repository::Client with Bugzilla itself, so that people don't have to install it. There's kind of a chicken-and-egg problem, then, though, because I can't ship a PAR of Compress::Raw::Zlib, and I can't include a single module that will work on everybody's system. Many systems already have "unzip" installed, and it would be nice if PAR could fall back on those if Compress::Raw::Zlib isn't installed. (Or Archive::Zip, for PAR::Repository::Client.) Or you could switch to using gzip, because all *nix distros have that available, though I imagine there's some good reason you didn't choose to go that way. Anyhow, any way that I could avoid having to make the user install an XS module from CPAN would be great.
Hi Max, sorry, I have mark the bug report as stalled. It's not going to happen, but read on: On Sun Oct 14 20:27:52 2007, MKANAT wrote: Show quoted text
> Right now the only platform-dependent prerequisite of PAR is > Compress::Raw::Zlib, which is pulled in by IO::Compress::Zlib.
[...] Show quoted text
> Many systems already have "unzip" installed, and it would be nice if PAR > could fall back on those if Compress::Raw::Zlib isn't installed. (Or > Archive::Zip, for PAR::Repository::Client.) Or you could switch to using > gzip, because all *nix distros have that available, though I imagine > there's some good reason you didn't choose to go that way.
[...] The short answer is: PAR itself cannot fall back to using anything but Archive::Zip. The long answer is: - PAR offers an API of accessing files from the archive via the Archive::Zip object. - It only extracts stuff on-demand by default. - This can't easily be changed without breaking expectations. However, there are various fall-backs wherever possible. - PAR::Dist can fall back to using unzip because its API doesn't expose the underlying mechanism. - PAR::Packer has recently picked up support for an experimental unzipping module Archive::Unzip::Burst which it can use whenever fully extracting the contents of a pp-packed binary executable. I never chose to not go with gzip, but the original author of PAR did. I suppose there are some good reasons, though. gzip needs tar to handle the "file system" structure of the archive. tar implementations differ from platform to platform. (GNU vs. POSIX) tar also has a structure which doesn't work well with "random access". unzip would be the next most widespread tool and one that should work the same everywhere. So to get a fallback-option on unzip, you would have to resort to using PAR::Dist only. That removes a lot of the flexibility but OTOH it's only a pure-perl module. It doesn't have any hard dependencies. You can do this with it: use PAR::Dist; install_par("http://par.bugzilla.org/Some-XS-Module-VERSION.par"); However, this requires LWP::Simple. (Which is pure-perl, IIRC.) You can also make it install into a local directory, but I gave you a script to do that before, I think. See http://search.cpan.org/dist/PAR-Dist/lib/PAR/Dist.pm#install_par Best regards, Steffen