Bug#863193: python-apt: Package.fullname and Package.architecture() is wrong for packages with 'all' architecture.
Package: python-apt
Version: 1.4.0~beta3
Severity: normal
Dear Maintainer,
apt.package.Package's fullname property and architecture method return the wrong architecture for packages with the 'all' architecture. A good example is the 'bash-completion' package:
$ dpkg -l bash-completion
...
ii bash-completion 1:2.1-4.3 all programmable completion for the bash shell
$ python
...
>>> cache = apt.Cache()
>>> pkg = cache['bash-completion']
>>> pkg.fullname
'bash-completion:amd64'
>>> pkg.architecture()
'amd64'
>>> pkg._pkg.architecture
'amd64'
>>> pkg.versions
<VersionList: ['1:2.1-4.3']>
>>> pkg.installed.architecture
'all'
>>> pkg.candidate.architecture
'all'
I'm not sure if this is even an issue with python-apt but rather an issue with libapt-pkg.
I'm also not sure what Package.architecture() should report in case the architecture of the installed and candidate package version differ, probably the installed architecture.
Last but not least here is a small test script:
#!/usr/bin/python3
import apt
cache = apt.cache.Cache()
for pkg in cache:
pkg_arch = pkg.architecture()
if pkg.installed:
inst_arch = pkg.installed.architecture
if pkg_arch != inst_arch:
print("%s: pkg.architecture() != pkg.installed.architecture: %s != %s" % (pkg.name, pkg_arch, inst_arch))
if pkg.candidate:
cand_arch = pkg.candidate.architecture
if pkg_arch != cand_arch:
print("%s: pkg.architecture() != pkg.candidate.architecture: %s != %s" % (pkg.name, pkg_arch, cand_arch))
Best,
Michael Schaller
-- System Information:
Debian Release: 9.0
Architecture: amd64
(x86_64)
Foreign Architectures: i386
Kernel: Linux 4.9.0-3-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
Versions of packages python-apt depends on:
ii dirmngr 2.1.18-6
ii gnupg 2.1.18-6
ii libapt-inst2.0 1.4.1
ii libapt-pkg5.0 1.4.1
ii libc6 2.24-10
ii libgcc1 1:6.3.0-18
ii libstdc++6 6.3.0-18
ii python 2.7.13-2
ii python-apt-common 1.4.0~beta3
pn python:any <none>
Versions of packages python-apt recommends:
ii iso-codes 3.75-1
ii lsb-release 9.20161125
ii xz-utils 5.2.2-1.2+b1
Versions of packages python-apt suggests:
ii apt 1.4.1
pn python-apt-dbg <none>
pn python-apt-doc <none>
-- no debconf information
Reply to: