diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-01-18 15:28:49 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-01-18 15:38:56 -0800 |
commit | 3d6f2529e9e230361868169bd14127ff0df9cb28 (patch) | |
tree | 4dd0225c3eaa34ee27268e6902c6c48aaef68241 /pym/_emerge | |
parent | 79c07efba28a5fe38561b2decb5021ba21590d29 (diff) | |
download | portage-3d6f2529e9e230361868169bd14127ff0df9cb28.tar.gz portage-3d6f2529e9e230361868169bd14127ff0df9cb28.tar.bz2 portage-3d6f2529e9e230361868169bd14127ff0df9cb28.zip |
depgraph: avoid updates more
The fix from bug #351828 broke some of the update avoidance behavior
from bug #275945, and this patch should restore it.
Diffstat (limited to 'pym/_emerge')
-rw-r--r-- | pym/_emerge/depgraph.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 1a203545f..4ccea99a8 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2914,7 +2914,8 @@ class depgraph(object): continue reinstall_for_flags = None - if not pkg.installed or matched_packages: + if not pkg.installed or \ + (matched_packages and not avoid_update): # Only enforce visibility on installed packages # if there is at least one other visible package # available. By filtering installed masked packages @@ -5411,18 +5412,21 @@ class _dep_check_composite_db(dbapi): myopts = self._depgraph._frozen_config.myopts use_ebuild_visibility = myopts.get( '--use-ebuild-visibility', 'n') != 'n' + avoid_update = "--update" not in myopts and \ + "remove" not in self._depgraph._dynamic_config.myparams usepkgonly = "--usepkgonly" in myopts - if not use_ebuild_visibility and usepkgonly: - return False - else: - try: - pkg_eb = self._depgraph._pkg( - pkg.cpv, "ebuild", pkg.root_config) - except portage.exception.PackageNotFound: + if not avoid_update: + if not use_ebuild_visibility and usepkgonly: return False else: - if not self._depgraph._pkg_visibility_check(pkg_eb): + try: + pkg_eb = self._depgraph._pkg( + pkg.cpv, "ebuild", pkg.root_config) + except portage.exception.PackageNotFound: return False + else: + if not self._depgraph._pkg_visibility_check(pkg_eb): + return False in_graph = self._depgraph._dynamic_config._slot_pkg_map[ self._root].get(pkg.slot_atom) |