commit:     e762752a8bf5c19e0d6d7b22de86306bfa4270ba
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  3 06:25:45 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Mar  3 06:27:12 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e762752a

dep_zapdeps: skip want_update_pkg if parent is None (bug 711400)

Skip the want_update_pkg call when parent is None, since passing
a None parent to want_update_pkg results in an error like this:

  File "libdep/dep_check.py", line 513, in dep_zapdeps
    if graph_interface.want_update_pkg(parent, avail_pkg):
  File "lib/_emerge/depgraph.py", line 5850, in _want_update_pkg
    depth = parent.depth or 0
AttributeError: 'NoneType' object has no attribute 'depth'

Fixes: f7d83d75c6b0 ("dep_zapdeps: adjust || preference for slot upgrades (bug 
706278)")
Bug: https://bugs.gentoo.org/711400
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/dep/dep_check.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/dep/dep_check.py b/lib/portage/dep/dep_check.py
index 1dd289eec..9534590bf 100644
--- a/lib/portage/dep/dep_check.py
+++ b/lib/portage/dep/dep_check.py
@@ -510,7 +510,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, 
trees=None,
                else:
                        new_slot_count = 0
                        for slot_atom, avail_pkg in slot_map.items():
-                               if graph_interface.want_update_pkg(parent, 
avail_pkg):
+                               if parent is not None and 
graph_interface.want_update_pkg(parent, avail_pkg):
                                        want_update = True
                                if (not slot_atom.cp.startswith("virtual/")
                                        and not graph_db.match_pkgs(slot_atom)):

Reply via email to