commit:     2366c903bab8f44463106e878f4e0c1ba81f42f8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 19 04:17:50 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Apr 20 19:39:00 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2366c903

depgraph._in_blocker_conflict: call _validate_blockers if needed (bug 615982)

Sometimes _complete_graph calls _slot_operator_update_probe, which
sometimes calls _in_blocker_conflict. This case occurs infrequently,
so call _validate_blockers only if needed.

Fixes: a83bb83909c5 ("depgraph: trigger slot operator rebuilds via 
_complete_graph (bug 614390)")
X-Gentoo-bug: 615982
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615982
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/_emerge/depgraph.py | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 3232816d5..e1119af3c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -2176,9 +2176,9 @@ class depgraph(object):
                only works after the _validate_blockers method has been called.
                """
 
-               if self._dynamic_config._blocked_pkgs is None:
-                       raise AssertionError(
-                               '_in_blocker_conflict called before 
_validate_blockers')
+               if (self._dynamic_config._blocked_pkgs is None
+                       and not self._validate_blockers()):
+                       raise self._unknown_internal_error()
 
                if pkg in self._dynamic_config._blocked_pkgs:
                        return True
@@ -6728,7 +6728,14 @@ class depgraph(object):
                packages within the graph.  If necessary, create hard deps to 
ensure
                correct merge order such that mutually blocking packages are 
never
                installed simultaneously. Also add runtime blockers from all 
installed
-               packages if any of them haven't been added already (bug 
128809)."""
+               packages if any of them haven't been added already (bug 128809).
+
+               Normally, this method is called only after the graph is 
complete, and
+               after _solve_non_slot_operator_slot_conflicts has had an 
opportunity
+               to solve slot conflicts (possibly removing some blockers). It 
can also
+               be called earlier, in order to get a preview of the blocker 
data, but
+               then it needs to be called again after the graph is complete.
+               """
 
                # The _in_blocker_conflict method needs to assert that this 
method
                # has been called before it, by checking that it is not None.

Reply via email to