summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-25 21:50:51 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-25 21:50:51 -0700
commit5b92ff7df1da825be1daed6734ba65dd71c944e4 (patch)
tree98ef62cd1610cd84f54fb8228915378a53c1c552
parentd39f85305d60b36140a2664b732cece701aa3c71 (diff)
downloadportage-5b92ff7df1da825be1daed6734ba65dd71c944e4.tar.gz
portage-5b92ff7df1da825be1daed6734ba65dd71c944e4.tar.bz2
portage-5b92ff7df1da825be1daed6734ba65dd71c944e4.zip
Bug #334365 - Fix depgraph._wrapped_select_pkg_highest_available_imp()
to avoid invalid or masked installed packages when necessary. This is especially important for invalid packages since they need be replaced so that their dependencies can be parsed for --depclean operations.
-rw-r--r--pym/_emerge/depgraph.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 435cc1a98..f933378aa 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2624,10 +2624,21 @@ class depgraph(object):
# Make --noreplace take precedence over --newuse.
if not pkg.installed and noreplace and \
cpv in vardb.match(atom):
- # If the installed version is masked, it may
- # be necessary to look at lower versions,
- # in case there is a visible downgrade.
- continue
+ inst_pkg = self._pkg(pkg.cpv, "installed",
+ root_config, installed=True)
+ mreasons = None
+ if not inst_pkg.invalid:
+ mreasons = _get_masking_status(inst_pkg,
+ pkgsettings, root_config,
+ use=self._pkg_use_enabled(inst_pkg))
+ if mreasons and len(mreasons) == 1 and \
+ mreasons[0].category == 'KEYWORDS':
+ mreasons = None
+ if not inst_pkg.invalid and not mreasons:
+ # If the installed version is masked, it may
+ # be necessary to look at lower versions,
+ # in case there is a visible downgrade.
+ continue
reinstall_for_flags = None
if not pkg.installed or \
@@ -2890,6 +2901,11 @@ class depgraph(object):
built_timestamp != installed_timestamp:
return built_pkg, existing_node
+ for pkg in matched_packages:
+ if pkg.installed and pkg.invalid:
+ matched_packages = [x for x in \
+ matched_packages if x is not pkg]
+
if avoid_update:
for pkg in matched_packages:
if pkg.installed and self._pkg_visibility_check(pkg, \