summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/depgraph.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-18 14:17:31 -0800
committerZac Medico <zmedico@gentoo.org>2011-01-18 14:26:18 -0800
commit79c07efba28a5fe38561b2decb5021ba21590d29 (patch)
treea0c64f6b94237e3c8950bd9bbc13b89d7a4b40c7 /pym/_emerge/depgraph.py
parentc3f96a63f186b1de3317309c61fb0fc98b8940c8 (diff)
downloadportage-79c07efba28a5fe38561b2decb5021ba21590d29.tar.gz
portage-79c07efba28a5fe38561b2decb5021ba21590d29.tar.bz2
portage-79c07efba28a5fe38561b2decb5021ba21590d29.zip
Fix some poor installed/masked || choices.
This will fix bug #351828. It's fallout from bug #350285.
Diffstat (limited to 'pym/_emerge/depgraph.py')
-rw-r--r--pym/_emerge/depgraph.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ba06fbc0f..1a203545f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -2914,14 +2914,16 @@ class depgraph(object):
continue
reinstall_for_flags = None
- if not pkg.installed or \
- (matched_packages and not avoid_update):
+ if not pkg.installed or matched_packages:
# Only enforce visibility on installed packages
# if there is at least one other visible package
# available. By filtering installed masked packages
# here, packages that have been masked since they
# were installed can be automatically downgraded
- # to an unmasked version.
+ # to an unmasked version. NOTE: This code needs to
+ # be consistent with masking behavior inside
+ # _dep_check_composite_db, in order to prevent
+ # incorrect choices in || deps like bug #351828.
if not self._pkg_visibility_check(pkg, \
allow_unstable_keywords=allow_unstable_keywords,
@@ -2933,15 +2935,8 @@ class depgraph(object):
# version is masked by KEYWORDS, but never
# reinstall the same exact version only due
# to a KEYWORDS mask. See bug #252167.
- if matched_packages:
- different_version = None
- for avail_pkg in matched_packages:
- if not portage.dep.cpvequal(
- pkg.cpv, avail_pkg.cpv):
- different_version = avail_pkg
- break
- if different_version is not None:
+ if matched_packages:
# If the ebuild no longer exists or it's
# keywords have been dropped, reject built
# instances (installed or binary).