Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH 3/3] depgraph._in_blocker_conflict: call _validate_blockers if needed (bug 615982)
Date: Wed, 19 Apr 2017 05:00:52
Message-Id: 20170419050007.7904-3-zmedico@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 1/3] digraph: add update and clear methods by Zac Medico
1 Sometimes _complete_graph calls _slot_operator_update_probe, which
2 sometimes calls _in_blocker_conflict. This case occurs infrequently,
3 so call _validate_blockers only if needed.
4
5 Fixes: a83bb83909c5 ("depgraph: trigger slot operator rebuilds via _complete_graph (bug 614390)")
6 X-Gentoo-bug: 615982
7 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=615982
8 ---
9 pym/_emerge/depgraph.py | 15 +++++++++++----
10 1 file changed, 11 insertions(+), 4 deletions(-)
11
12 diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
13 index 3232816..e1119af 100644
14 --- a/pym/_emerge/depgraph.py
15 +++ b/pym/_emerge/depgraph.py
16 @@ -2176,9 +2176,9 @@ class depgraph(object):
17 only works after the _validate_blockers method has been called.
18 """
19
20 - if self._dynamic_config._blocked_pkgs is None:
21 - raise AssertionError(
22 - '_in_blocker_conflict called before _validate_blockers')
23 + if (self._dynamic_config._blocked_pkgs is None
24 + and not self._validate_blockers()):
25 + raise self._unknown_internal_error()
26
27 if pkg in self._dynamic_config._blocked_pkgs:
28 return True
29 @@ -6728,7 +6728,14 @@ class depgraph(object):
30 packages within the graph. If necessary, create hard deps to ensure
31 correct merge order such that mutually blocking packages are never
32 installed simultaneously. Also add runtime blockers from all installed
33 - packages if any of them haven't been added already (bug 128809)."""
34 + packages if any of them haven't been added already (bug 128809).
35 +
36 + Normally, this method is called only after the graph is complete, and
37 + after _solve_non_slot_operator_slot_conflicts has had an opportunity
38 + to solve slot conflicts (possibly removing some blockers). It can also
39 + be called earlier, in order to get a preview of the blocker data, but
40 + then it needs to be called again after the graph is complete.
41 + """
42
43 # The _in_blocker_conflict method needs to assert that this method
44 # has been called before it, by checking that it is not None.
45 --
46 2.10.2

Replies