1 |
commit: 1d9df5eec15e883b38879bebdac7294cb51756ad |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 9 06:28:59 2015 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 9 16:46:53 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d9df5ee |
7 |
|
8 |
depgraph._too_deep: fix logic when deep is True (bug 566024) |
9 |
|
10 |
Since commit cc8724b80ec7da713baed3d3a88c0bb99fc368b7, the _too_deep |
11 |
method erroneously returned True when deep was True. When deep is True |
12 |
and depth is an int, the method is intended to return False, therefore |
13 |
fix it to do so. This fixes the dep.want_update assignment from commit |
14 |
cc8724b80ec7 to behave correctly, which solves bug 566024 because it |
15 |
corrects behavior of the _slot_operator_trigger_reinstalls method. |
16 |
|
17 |
Fixes: cc8724b80ec7 ("depgraph._want_update_pkg: handle _UNREACHABLE_DEPTH (bug 554928)") |
18 |
X-Gentoo-Bug: 566024 |
19 |
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=566024 |
20 |
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org> |
21 |
|
22 |
pym/_emerge/depgraph.py | 10 ++++++++-- |
23 |
1 file changed, 8 insertions(+), 2 deletions(-) |
24 |
|
25 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
26 |
index fa83ae8..2169b00 100644 |
27 |
--- a/pym/_emerge/depgraph.py |
28 |
+++ b/pym/_emerge/depgraph.py |
29 |
@@ -5407,8 +5407,14 @@ class depgraph(object): |
30 |
@return: True if the package is deeper than the max allowed depth |
31 |
""" |
32 |
deep = self._dynamic_config.myparams.get("deep", 0) |
33 |
- return depth is self._UNREACHABLE_DEPTH or ( |
34 |
- isinstance(deep, int) and isinstance(depth, int) and depth > deep) |
35 |
+ if depth is self._UNREACHABLE_DEPTH: |
36 |
+ return True |
37 |
+ elif deep is True: |
38 |
+ return False |
39 |
+ else: |
40 |
+ # All non-integer cases are handled above, |
41 |
+ # so both values must be int type. |
42 |
+ return depth > deep |
43 |
|
44 |
def _depth_increment(self, depth, n=1): |
45 |
""" |