I'm not entirely sure what you expect out of this bug report. Is this
a support request? If so a mail to debian-dpkg might have been better.
Also CCing the package address helps seeing the issue more quickly.

On Fri, 2016-01-01 at 14:04:05 +0000, Sandro Tosi wrote:
> Dear dpkg maintainer, how can reportbug understand if a package needs
> arch-qualification or not? for example
> $ dpkg-query -W gcc-5-base
> gcc-5-base:amd64        5.2.1-24
> gcc-5-base:i386 5.2.1-24
> but
> $ dpkg-query -W dpkg
> dpkg    1.18.3

«dpkg-query -W» will arch-qualify packages when needed. The current
rules for arch-qualifying can be found in dpkg-query(1), in the
description of the binary:Package virtual field.

> we are currently using the 'status' file (we are parsing it matching
> on '^Package:'), where:
> $ dpkg --status gcc-5-base:amd64
> Package: gcc-5-base
> Status: install ok installed
> Priority: required
> Section: libs
> Installed-Size: 197
> Maintainer: Debian GCC Maintainers <debian-...@lists.debian.org>
> Architecture: amd64
> [8<]
> so the Package line doesnt have the arch qualification so our
> file-parsing doesnt return it, but from the command line we need to
> specify it else:
> $ dpkg --status gcc-5-base
> dpkg-query: error: --status needs a valid package name but
> 'gcc-5-base' is not: ambiguous package name 'gcc-5-base' with more
> than one installed instance

Any command that requires a specific package instance, needs to be
unambiguous, the commands accepting patterns do not need to, and
something like «dpkg-query -W gcc-5-base» is equivalent to
«dpkg-query -W gcc-5-base:*».

> how can we improve that in reportbug? is there a better way to
> retrieve such information? ideally if someone wants to report a bug
> against 'gcc-5-base' we should be able to return the 2 entries as of:
> $ dpkg-query -W gcc-5-base
> gcc-5-base:amd64        5.2.1-24
> gcc-5-base:i386 5.2.1-24
> (we also provide the description, that's why we use the status db).

I'm not exactly sure what you are asking for here. You need to either
parse the status file, and match the arch-qualifying rules documented
in dpkg-query. Or you could use something lile:

  «dpkg-query -f '${binary:Package} ${Version}\n ${Description}\n' pkg»

or any other formatting you might want to parse.


Reportbug-maint mailing list

Reply via email to