Skip Menu |

This queue is for tickets about the DPKG-Parse CPAN distribution.

Report information
The Basics
Id: 127511
Status: open
Priority: 0/
Queue: DPKG-Parse

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

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



Subject: DPKG::Parse(3pm) claims that Packages.gz is "understood", but doesn't support compressed files
Date: Mon, 29 Oct 2018 17:09:48 +0100
To: bug-DPKG-Parse [...] rt.cpan.org
From: Axel Beckert <abe [...] cpan.org>
Hi, this has been initially reported in Debian against DPKG::Parse version 0.03 at https://bugs.debian.org/912244 Citing from the DPKG::Parse(3pm) POD/man-page: Show quoted text
> 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: Show quoted text
> 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. Probably a nice way to fix this would be to accept IO::* objects instead of insisting on files, e.g. passing an IO::Uncompress::AnyUncompress object. Kind regards, Axel -- PGP: 2FF9CD59612616B5 /~\ Plain Text Ribbon Campaign, http://arc.pasp.de/ Mail: abe@deuxchevaux.org \ / Say No to HTML in E-Mail and Usenet Mail+Jabber: abe@noone.org X https://axel.beckert.ch/ / \ I love long mails: https://email.is-not-s.ms/
Subject: Re: [rt.cpan.org #127511] DPKG::Parse(3pm) claims that Packages.gz is "understood", but doesn't support compressed files
Date: Mon, 29 Oct 2018 17:40:56 +0100
To: Bugs in DPKG-Parse via RT <bug-DPKG-Parse [...] rt.cpan.org>, Debian Bug #912244 <912244 [...] bugs.debian.org>
From: Axel Beckert <abe [...] debian.org>
Hi, small correction: Axel Beckert wrote: Show quoted text
> But if I parse a gzip compressed packages file as "filename", I just get > "undef" returned by the constructor "new".
Actually it's $obiect->get_packages(…) which always returns undef. And that's because of https://rt.cpan.org/Public/Bug/Display.html?id=110014 If I call $obiect->parse() before that, I get either undef or the code die()s with "line 1: I have no idea what to do with '<gzip-garbled-content>'". Regards, Axel -- ,''`. | Axel Beckert <abe@debian.org>, https://people.debian.org/~abe/ : :' : | Debian Developer, ftp.ch.debian.org Admin `. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5 `- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE