diff options
-rw-r--r-- | pym/_emerge/Package.py | 7 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 0b3375edc..c80bad3ac 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 badbb506d..f62af31b8 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 |