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

Bug#750189: python-apt: compare_to_version_in_cache() not aware of multiarch



Control: tag -1 pending

On Mon, Jun 02, 2014 at 08:17:32PM +0800, Limbo Peng wrote:
> Package: python-apt
> Version: 0.9.3.6
> Severity: normal
> 
> Dear Maintainer,
> 
> python-apt fails to find installed packages of different architecture
> when reading metadata from a deb file. For example, I've installed
> libopenjpeg5:i386 on an amd64 system:

Thanks for your bug report. This is fixed in git now with the
following commit

>From 7fff13ba3ee863bd84ed910523939069b966dbd7 Mon Sep 17 00:00:00 2001
From: Julian Andres Klode <jak@debian.org>
Date: Wed, 10 Jun 2015 17:34:04 +0200
Subject: [PATCH] apt/debfile.py: Arch-qualify in compare_to_version_in_cache()

This uses the native architecture if the packages architecture
is all, and the other architecture in case. We might need to
consider versioned provides here, I have not looked at that
yet.

Closes: #750189
---
 apt/debfile.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/apt/debfile.py b/apt/debfile.py
index d542ada..22f96bf 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -456,6 +456,15 @@ class DebPackage(object):
         """
         self._dbg(3, "compare_to_version_in_cache")
         pkgname = self._sections["Package"]
+        architecture = self._sections["Architecture"]
+
+        # Architecture all gets mapped to the native architecture internally
+        if architecture == 'all':
+            architecture = apt_pkg.config.find("APT::Architecture")
+
+        # Arch qualify the package name
+        pkgname = ":".join([pkgname, architecture])
+
         debver = self._sections["Version"]
         self._dbg(1, "debver: %s" % debver)
         if pkgname in self._cache:
-- 
2.1.4

-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

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

Be friendly, do not top-post, and follow RFC 1855 "Netiquette".
    - If you don't I might ignore you.


Reply to: