Bug#912244: libdpkg-parse-perl: DPKG::Parse(3pm) claims that Packages.gz is "understood", but doesn't support compressed files
Axel Beckert
abe at debian.org
Mon Oct 29 15:38:20 GMT 2018
Package: libdpkg-parse-perl
Version: 0.03-1
Severity: normal
Tags: upstream
Hi,
from the DPKG::Parse(3pm) POD/man-page:
> DESCRIPTION
> DPKG::Parse contains utilities to parse the various files created by
> dpkg and turn them into helpful Perl objects. Current files
> understood by various DPKG::Parse modules:
>
> /var/lib/dpkg/status - DPKG::Parse::Status
> /var/lib/dpkg/available - DPKG::Parse::Available
> Packages.gz - DPKG::Parse::Packages
^^^
But if I parse a gzip compressed packages file as "filename", I just get
"undef" returned by the constructor "new".
Looking at the code, there's no sign of decompression:
> sub parse_package_format {
> my $pkg = shift;
> if (! -f $pkg->filename) {
> die "Cannot find " . $pkg->filename . ", or it's not a file at all!";
> }
> open(STATUS, $pkg->filename);
> my $entry;
> my $line_num = -1;
> my $entry_line = 0;
> STATUSLINE: while (my $line = <STATUS>) {
> ++$line_num;
> if ($line =~ /^\n$/) {
[...]
The easy fix would be to remove that misleading ".gz" from the POD. But
it actually would be nice to be able to transparently read Packages.gz,
Packages.bzip2 and Packages.xz files with that module.
Issue initially noticed on Stretch, but according to the
debian/changelog nothing in that direction has changed so far in
Buster/Sid.
-- System Information:
Debian Release: 9.5
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-7-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages libdpkg-parse-perl depends on:
ii libclass-accessor-perl 0.34-1
ii libclass-c3-perl 0.32-1
ii libparams-validate-perl 1.26-1
ii perl 5.24.1-3+deb9u4
libdpkg-parse-perl recommends no packages.
libdpkg-parse-perl suggests no packages.
-- no debconf information
More information about the pkg-perl-maintainers
mailing list