From dd512c0e119eb1e07053ec1bb349f044e465d44e Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Wed, 14 Apr 2010 15:47:24 +0200 Subject: [PATCH] --update: don't match lower versions if the higher versions have the wrong use config --- pym/_emerge/depgraph.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 1f326e87c..65df15c55 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2414,6 +2414,7 @@ class depgraph(object): reinstall = False noreplace = "--noreplace" in self._frozen_config.myopts avoid_update = "--update" not in self._frozen_config.myopts + dont_miss_updates = "--update" in self._frozen_config.myopts use_ebuild_visibility = self._frozen_config.myopts.get( '--use-ebuild-visibility', 'n') != 'n' # Behavior of the "selective" parameter depends on @@ -2428,6 +2429,7 @@ class depgraph(object): # available packages match argument atoms, which is # represented by the found_available_arg flag. found_available_arg = False + packages_with_invalid_use_config = [] for find_existing_node in True, False: if existing_node: break @@ -2445,6 +2447,18 @@ class depgraph(object): if pkg in self._dynamic_config._runtime_pkg_mask: # The package has been masked by the backtracking logic continue + + if dont_miss_updates: + higher_version_rejected = False + for rejected in packages_with_invalid_use_config: + if rejected.cp != pkg.cp: + continue + if rejected > pkg: + higher_version_rejected = True + break + if higher_version_rejected: + continue + cpv = pkg.cpv # Make --noreplace take precedence over --newuse. if not pkg.installed and noreplace and \ @@ -2521,8 +2535,10 @@ class depgraph(object): if atom.use and not pkg.built: use = pkg.use.enabled if atom.use.enabled.difference(use): + packages_with_invalid_use_config.append(pkg) continue if atom.use.disabled.intersection(use): + packages_with_invalid_use_config.append(pkg) continue if pkg.cp == atom_cp: if highest_version is None: -- 2.26.2