diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 2acd8f2e13..512afe12ce 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -9897,8 +9897,20 @@ def find_smallest_cycle(mergeable_nodes, local_priority_range): except KeyError: pass else: - uninst_task = node - ignored_uninstall_tasks.add(node) + handler = circular_dependency_handler(self, mygraph) + if handler.solutions: + pkg = list(handler.solutions.keys())[0] + parent, solution = list(handler.solutions[pkg])[0] + solution = list(solution)[0] + enabled = list(parent.use.enabled) + if solution[1]: + enabled.append(solution[0]) + else: + enabled.remove(solution[0]) + selected_nodes = [parent.with_use(enabled), pkg, parent] + else: + uninst_task = node + ignored_uninstall_tasks.add(node) break if uninst_task is not None: diff --git a/lib/_emerge/resolver/circular_dependency.py b/lib/_emerge/resolver/circular_dependency.py index 6c21423083..09b1afebfb 100644 --- a/lib/_emerge/resolver/circular_dependency.py +++ b/lib/_emerge/resolver/circular_dependency.py @@ -293,7 +293,7 @@ def _find_suggestions(self): " (This change might require USE changes on parent packages.)" ) suggestions.append(msg) - final_solutions.setdefault(pkg, set()).add(solution) + final_solutions.setdefault(pkg, set()).add((parent, solution)) return final_solutions, suggestions