From 997c6bdf15ce701d59262b5a5491f33dad88f198 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 15 Mar 2007 14:17:53 -0400 Subject: [PATCH] Get all potential matches for deps, let install time figure the best one to use. Remove code stolen from anaconda as it isnt needed anymore. This may bloat the compose, but we need the multiarch stuff and potential matches so that install time can figure out what to use. --- Changelog | 2 ++ pypungi/gather.py | 27 +-------------------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Changelog b/Changelog index 938f5cdb..8bac0f18 100644 --- a/Changelog +++ b/Changelog @@ -2,6 +2,8 @@ - Use yum's built in exclude handling - Use yum's built in conditional handling for things from comps - Do excludes before group handling. +- Get all potential matches for deps, let install time figure + the best one to use. * Tue Mar 14 2007 Jesse Keating - Do things faster/smarter if we've only asked for one disc diff --git a/pypungi/gather.py b/pypungi/gather.py index 44587757..a8b64287 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -71,31 +71,6 @@ class Gather(yum.YumBase): # the logging. pass - def _provideToPkg(self, req): #this is stolen from Anaconda - """Return a list of best possible providers for a requirement. - - Returns a list or None""" - - - bestlist = None - (r, f, v) = req - - satisfiers = [] - for po in self.whatProvides(r, f, v): - # if we already have something installed which does the provide - # then that's obviously the one we want to use. this takes - # care of the case that we select, eg, kernel-smp and then - # have something which requires kernel - if self.tsInfo.getMembers(po.pkgtup): - return [po] - if po not in satisfiers: - satisfiers.append(po) - - if satisfiers: - bestlist = self.bestPackagesFromList(satisfiers, arch=self.compatarch) - return bestlist - return None - def getPackageDeps(self, po): """Return the dependencies for a given package, as well possible solutions for those dependencies. @@ -119,7 +94,7 @@ class Gather(yum.YumBase): if req in provs: continue - deps = self._provideToPkg(req) + deps = self.whatProvides(r, f, v).returnPackages() if deps is None: self.logger.warning("Unresolvable dependency %s in %s" % (r, po.name)) continue