From d52136a4c1d838f295b85acba96d3813f4123bcf Mon Sep 17 00:00:00 2001 From: "jkeating@dhcp83-49.boston.redhat.com" <> Date: Mon, 27 Nov 2006 22:17:29 -0500 Subject: [PATCH] Make sure we only get the newest package objects. --- pypungi/gather.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pypungi/gather.py b/pypungi/gather.py index 4260faf5..1aa6b8f5 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -53,7 +53,7 @@ class Gather(yum.YumBase): continue provides = self.whatProvides(r, f, v) - for provide in provides: + for provide in provides.returnNewestByNameArch(): if not pkgresults.has_key(provide): pkgresults[provide] = None @@ -71,7 +71,9 @@ class Gather(yum.YumBase): for pkg in self.pkglist: # cycle through our package list and get repo matches matches = self.pkgSack.searchNevra(name=pkg) - for match in matches: + mysack = yum.packageSack.ListPackageSack(matches) + + for match in mysack.returnNewestByNameArch(): unprocessed_pkgs[match] = None if not self.config.has_option('default', 'quiet'):