commit: e5d638cf855656afab141da8d7b4d7f66cad3450
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 16 20:48:48 2017 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Mar 16 23:21:04 2017 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5d638cf
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 <AT> gentoo.org>
pym/_emerge/depgraph.py | 17 ++++++++++++++---
1 file 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)