diff --git a/yum/__init__.py b/yum/__init__.py index 3457dfb..20f9f63 100644 --- a/yum/__init__.py +++ b/yum/__init__.py @@ -1898,14 +1898,21 @@ class YumBase(depsolve.Depsolve): continue # Otherwise we hook into tsInfo.add pkgs = self.pkgSack.searchNevra(name=condreq) - if pkgs:# if there's anything as a result then we push - # the name into tsInfo so that when we call install - # on it it passes through the normal install() call - if self.tsInfo.conditionals.has_key(cond): - self.tsInfo.conditionals[cond].append(condreq) - else: - self.tsInfo.conditionals[cond] = [condreq] - + if pkgs: + if rpmUtils.arch.isMultiLibArch(): + if self.conf.multilib_policy == 'best': + best = rpmUtils.arch.legitMultiArchesInSameLib() + best.append('noarch') + for pkg in pkgs: + if pkg.arch in best: + use.append(pkg) + pkgs = use + + pkgs = packagesNewestByNameArch(pkgs) + + if not self.tsInfo.conditionals.has_key(cond): + self.tsInfo.conditionals[cond] = [] + self.tsInfo.conditionals[cond].extend(pkgs) return txmbrs_used def deselectGroup(self, grpid): diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py index 6dd92b8..5a843fd 100644 --- a/yum/transactioninfo.py +++ b/yum/transactioninfo.py @@ -193,10 +193,10 @@ class TransactionData: self.pkgSackPackages += 1 if self.conditionals.has_key(txmember.name): - for pkg_name in self.conditionals[txmember.name]: - if self.rpmdb.contains(name=pkg_name): + for pkg in self.conditionals[txmember.name]: + if self.rpmdb.contains(po=pkg): continue - for condtxmbr in self.install_method(name=pkg_name): + for condtxmbr in self.install_method(po=pkg): condtxmbr.setAsDep(po=txmember.po) self._unresolvedMembers.add(txmember)