aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-03 07:13:56 (GMT)
committerZac Medico <zmedico@gentoo.org>2011-01-03 07:13:56 (GMT)
commit029ec2b89b7d55c68d89b6dff3dbe5539825e71a (patch)
treebe50756147758f739036ba826691859e877318e7
parentRepoConfig: invert repo priority ordering (diff)
downloadportage-029ec2b89b7d55c68d89b6dff3dbe5539825e71a.zip
portage-029ec2b89b7d55c68d89b6dff3dbe5539825e71a.tar.gz
portage-029ec2b89b7d55c68d89b6dff3dbe5539825e71a.tar.bz2
depgraph: prefer highest priority repo more often
Prefer the highest priority repo, even when the ebuild from the higher priority repo requires USE adjustments due to USE deps or REQUIRED_USE. This will fix bug #350254.
-rw-r--r--pym/_emerge/Package.py7
-rw-r--r--pym/_emerge/depgraph.py10
2 files changed, 17 insertions, 0 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py
index 0b3375e..c80bad3 100644
--- a/pym/_emerge/Package.py
+++ b/pym/_emerge/Package.py
@@ -352,6 +352,13 @@ class Package(Task):
return self.metadata['repository']
@property
+ def repo_priority(self):
+ repo_info = self.root_config.settings.repositories.prepos.get(self.repo)
+ if repo_info is None:
+ return None
+ return repo_info.priority
+
+ @property
def use(self):
if self._use is None:
self.metadata._init_use()
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index badbb50..f62af31 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2877,12 +2877,22 @@ class depgraph(object):
# list only contains unbuilt ebuilds since USE can't
# be changed for built packages.
higher_version_rejected = False
+ repo_priority = pkg.repo_priority
for rejected in packages_with_invalid_use_config:
if rejected.cp != pkg.cp:
continue
if rejected > pkg:
higher_version_rejected = True
break
+ if portage.dep.cpvequal(rejected.cpv, pkg.cpv):
+ # If version is identical then compare
+ # repo priority (see bug #350254).
+ rej_repo_priority = rejected.repo_priority
+ if rej_repo_priority is not None and \
+ (repo_priority is None or
+ rej_repo_priority > repo_priority):
+ higher_version_rejected = True
+ break
if higher_version_rejected:
continue