Daniel Robbins isolated the problem in the area of code: > for pkg in pkgs: > eliminate_pkg = True > for atom in atom_pkg_graph.parent_nodes(pkg): > if len(atom_pkg_graph.child_nodes(atom)) < 2: > eliminate_pkg = False > break > if eliminate_pkg: > atom_pkg_graph.remove(pkg) The problem is that the order of iteration of the pkgs set is random. This causes packages to be removed from atom_pkg_graph in random order, and their removal affects the atom_pkg_graph.child_nodes(atom) results for packages processed in later iterations of the loop, leading to a random outcome.
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/a397157615f148c0c9b9cbdc7cb718e2 https://github.com/gentoo/portage/pull/209
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5b286b267cb5cc69cac1c99ec8704ff0e0463e11
Released in 2.3.11.