Make sure we only get the newest package objects.

This commit is contained in:
jkeating@dhcp83-49.boston.redhat.com 2006-11-27 22:17:29 -05:00 committed by Jesse Keating
parent f188205cf9
commit d52136a4c1

View File

@ -53,7 +53,7 @@ class Gather(yum.YumBase):
continue continue
provides = self.whatProvides(r, f, v) provides = self.whatProvides(r, f, v)
for provide in provides: for provide in provides.returnNewestByNameArch():
if not pkgresults.has_key(provide): if not pkgresults.has_key(provide):
pkgresults[provide] = None 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 for pkg in self.pkglist: # cycle through our package list and get repo matches
matches = self.pkgSack.searchNevra(name=pkg) matches = self.pkgSack.searchNevra(name=pkg)
for match in matches: mysack = yum.packageSack.ListPackageSack(matches)
for match in mysack.returnNewestByNameArch():
unprocessed_pkgs[match] = None unprocessed_pkgs[match] = None
if not self.config.has_option('default', 'quiet'): if not self.config.has_option('default', 'quiet'):