Blob Blame History Raw
From c817e88c5929c3a1448f47f6e16db86eef4fbf55 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard@hughsie.com>
Date: Thu, 6 Sep 2012 09:09:19 +0100
Subject: [PATCH] yum: Work around a yum API break so that resolving still
 works

In e42ea3dc0b02ba73a11211de4062e87abfb77a6a yum changed the public API so that
str(repo) returned 'fedora/18/i386' rather than just 'fedora'.
This broke PackageKit pretty hard as the repo name is used in the package_id.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=854209
---
 backends/yum/yumBackend.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 6117729..9da52bb 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -2599,7 +2599,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
 
     def _pkg_to_id(self, pkg):
         pkgver = _get_package_ver(pkg)
-        repo = str(pkg.repo)
+        repo = pkg.repo.id
         if repo.startswith('/'):
             repo = "local"
         # can we add data from the yumdb
-- 
1.7.11.4