aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2017-03-16 13:48:48 -0700
committerZac Medico <zmedico@gentoo.org>2017-03-16 16:21:04 -0700
commite5d638cf855656afab141da8d7b4d7f66cad3450 (patch)
treef7f7f31f07a0fb064326d0a318f136790d0daf59
parentdepgraph: fix slot operator rebuild for llvm:0 to llvm:4 upgrade (bug 612772) (diff)
downloadportage-e5d638cf855656afab141da8d7b4d7f66cad3450.tar.gz
portage-e5d638cf855656afab141da8d7b4d7f66cad3450.tar.bz2
portage-e5d638cf855656afab141da8d7b4d7f66cad3450.zip
depgraph: fix missed atom_not_selected initialization (bug 612846)
Fix the _slot_operator_update_probe method to ensure that the atom_not_selected variable is always properly initialized. This problem prevented the method from identifying slot operator rebuild candidates, leading to dependency conflicts and/or missed updates. For example, this may have triggered the missed llvm update reported in bug 611742, since these dependencies from the mesa-17.0.1 ebuild are capable of triggering the problem, when atom_not_selected is not properly set to True for the second atom: || ( sys-devel/llvm:4[${MULTILIB_USEDEP}] >=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}] ) X-Gentoo-bug: 612846 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=612846 Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/_emerge/depgraph.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ad94fb70f..f4145d05f 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -1895,7 +1895,9 @@ class depgraph(object):
all_candidate_pkgs = None
for atom in atoms:
- atom_not_selected = False
+ # The _select_atoms_probe method is expensive, so initialization
+ # of this variable is only performed on demand.
+ atom_not_selected = None
if not atom.package:
unevaluated_atom = None
@@ -1977,8 +1979,8 @@ class depgraph(object):
if selected_atoms is None:
selected_atoms = self._select_atoms_probe(
dep.child.root, replacement_parent)
- if unevaluated_atom not in selected_atoms:
- atom_not_selected = True
+ atom_not_selected = unevaluated_atom not in selected_atoms
+ if atom_not_selected:
break
if not insignificant and \
@@ -1989,6 +1991,15 @@ class depgraph(object):
(pkg, unevaluated_atom or atom))
candidate_pkgs.append(pkg)
+ # When unevaluated_atom is None, it means that atom is
+ # an soname atom which is unconditionally selected, and
+ # _select_atoms_probe is not applicable.
+ if atom_not_selected is None and unevaluated_atom is not None:
+ if selected_atoms is None:
+ selected_atoms = self._select_atoms_probe(
+ dep.child.root, replacement_parent)
+ atom_not_selected = unevaluated_atom not in selected_atoms
+
if atom_not_selected:
continue
replacement_candidates.append(candidate_pkg_atoms)