Re: Please add lzip support in the repository
Stuart Prescott writes ("Re: Please add lzip support in the repository"):
> > What is `apt-helper cat-file' and how does it help ?
> On stretch:
> $ apt-file search apt-helper
> apt: /usr/lib/apt/apt-helper
Ah. I looked on PATH. I expect "Front door" programs to be on PATH
> $ /usr/lib/apt/apt-helper download-file
> Get:1 http://deb.debian.org/debian/dists/sid/main/binary-amd64/Packages.xz
> [7,547 kB]
> Fetched 7,547 kB in 5s (1,446 kB/s)
> $ /usr/lib/apt/apt-helper cat-file Packages.xz | less
So this is not really a replacement for the impugned compression
* it's not available in stable (some of us care about backportability
and supporting stable users)
* it involves invoking a command and parsing the output to get
trivial information which should be available as a simple
variable in a scripting language
* it provides only a more-cooked interface than is probably wanted
A better answer would be the perl function
which is fairly easy to use and has been available for a long time.
Useable something like this:
Or if you just want to strip the compression extension then
and call compression_guess_from_filename on $1 and see if it's undef.
See for example
Ideally other languages should have something similar.