[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#772613: python-apt: apt_pkg.Dependency().target_pkg should be native version for multi-arch: Foreign



Control: reassign -1 apt

[Something for David to look at :)]

On Tue, Dec 09, 2014 at 04:59:29PM +1000, Russell Stuart wrote:
> Package: python-apt Version: 0.9.3.11 Severity: normal
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Dear Maintainer,
> 
> apt_pkg.Dependency objects returned by apt_pkg.Version.depends_list
> select a apt_pkg.Dependency.target_pkg that has the same architecture
> as the apt_pkg.Version that generated it (Architecture: all packages
> aside).  Usually this is the right thing do to.
> 
> The one time is isn't is when target_pkg is "multi-arch: Foreign".
> In that case you always want the native package, if it is available.
> 
> Eg consider a system that wants both libgcc1:amd64 and libgcc1:i386
> installed.  libgcc1 PreDepends on multiarch-support.
> multiarch-support:amd64 conflicts with multiarch-support:i386, so
> you can't have both installed.  But currently if you just use the
> suggested target_pkg, you will attempt to install both.  apt-get and
> aptitude resolve this by only installing the native version, and it
> would be nice if apk_pkg did the same.
> 
> Example:
> 
>   import apt_pkg
>   apt_pkg.init()
>   cache = apt_pkg.Cache()
>   dep_cache = apt_pkg.DepCache(cache)
>   libgcc1_i386 = cache["libgcc1:i386"]
>   version = dep_cache.get_candidate_ver(libgcc1_i386)
>   depends = version.depends_list["PreDepends"][0][0]
>   target_pkg = depends.target_pkg
>   print target_pkg.name, target_pkg.architecture
>   print depends.all_targets()[0].multi_arch == apt_pkg.Version.MULTI_ARCH_FOREIGN
>   print cache["multiarch-support"].architecture, cache["dpkg"].architecture
> 
> Prints:
>   multiarch-support i386
>   True
>   amd64 amd64
> 
> A better result would be:
>   multiarch-support amd64
>   True
>   amd64 amd64
> 

Reassigning to APT, python-apt just calls the TargetPkg() method there.

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.


Reply to: