commit:     1d9df5eec15e883b38879bebdac7294cb51756ad
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  9 06:28:59 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Dec  9 16:46:53 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1d9df5ee

depgraph._too_deep: fix logic when deep is True (bug 566024)

Since commit cc8724b80ec7da713baed3d3a88c0bb99fc368b7, the _too_deep
method erroneously returned True when deep was True. When deep is True
and depth is an int, the method is intended to return False, therefore
fix it to do so. This fixes the dep.want_update assignment from commit
cc8724b80ec7 to behave correctly, which solves bug 566024 because it
corrects behavior of the _slot_operator_trigger_reinstalls method.

Fixes: cc8724b80ec7 ("depgraph._want_update_pkg: handle _UNREACHABLE_DEPTH (bug 
554928)")
X-Gentoo-Bug: 566024
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=566024
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>

 pym/_emerge/depgraph.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index fa83ae8..2169b00 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5407,8 +5407,14 @@ class depgraph(object):
                @return: True if the package is deeper than the max allowed 
depth
                """
                deep = self._dynamic_config.myparams.get("deep", 0)
-               return depth is self._UNREACHABLE_DEPTH or (
-                       isinstance(deep, int) and isinstance(depth, int) and 
depth > deep)
+               if depth is self._UNREACHABLE_DEPTH:
+                       return True
+               elif deep is True:
+                       return False
+               else:
+                       # All non-integer cases are handled above,
+                       # so both values must be int type.
+                       return depth > deep
 
        def _depth_increment(self, depth, n=1):
                """

Reply via email to