summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2008-04-17 14:56:02 +0100
committerRichard Hughes <richard@hughsie.com>2008-04-20 21:58:14 +0100
commit71fce449604ca139beb5e3b0b6f626b9e52ad6da (patch)
treeff9dc1f0c59316c7a65f72a8a535dc3cace93b36
parent619875f3fef96e8d776736b64346b426685ef206 (diff)
yum: improve the BASENAME filter by preferably matching against a non -devel and -debuginfo package
-rw-r--r--backends/yum/helpers/yumBackend.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index 0fe346b3a..d1d7a6574 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -1108,6 +1108,15 @@ class PackageKitYumBackend(PackageKitBaseBackend):
else:
return INFO_UNKNOWN
+ def _is_main_package(self, repo):
+ if repo.endswith('-debuginfo'):
+ return False
+ if repo.endswith('-devel'):
+ return False
+ if repo.endswith('-libs'):
+ return False
+ return True
+
def _basename_filter(self, package_list):
'''
Filter the list so that the number of packages are reduced.
@@ -1137,7 +1146,14 @@ class PackageKitYumBackend(PackageKitBaseBackend):
output_list.append((pkg,status))
base_list_already_got.append ((base,version))
- #for all the already added output lists, remove the same basename from base_list
+ #for all the ones not yet got, can we match against a non devel match?
+ for (pkg,status,base,version) in base_list:
+ if (base,version) not in base_list_already_got:
+ if self._is_main_package(pkg.name):
+ output_list.append((pkg,status))
+ base_list_already_got.append ((base,version))
+
+ #add the remainder of the packages, which should just be the single debuginfo's
for (pkg,status,base,version) in base_list:
if (base,version) not in base_list_already_got:
output_list.append((pkg,status))