aboutsummaryrefslogtreecommitdiffstats
path: root/lib/_emerge/depgraph.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2023-11-22 13:46:12 -0800
committerZac Medico <zmedico@gentoo.org>2023-11-22 14:26:13 -0800
commitcdc781349337fa755bc15773e2a87e4b41f5ff1e (patch)
treeeb56b8c8875ba82377b47de774e5c0aa34d84b9c /lib/_emerge/depgraph.py
parentfind_smallest_cycle: Increase ignore_priority to find smaller cycles (diff)
downloadgentoo-portage-cdc781349337fa755bc15773e2a87e4b41f5ff1e.tar.xz
gentoo-portage-cdc781349337fa755bc15773e2a87e4b41f5ff1e.zip
Revert "find_smallest_cycle: Increase ignore_priority to find smaller cycles"
This reverts commit 9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e. The len(smallest_cycle) == 1 loop termination condition is not optimal and it's too expensive as reported in bug 917660. Bug: https://bugs.gentoo.org/917660 Bug: https://bugs.gentoo.org/917259 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r--lib/_emerge/depgraph.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 0d3b37c6985a..e4305c18c96a 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -9345,10 +9345,9 @@ class depgraph:
smallest_cycle = selected_nodes
ignore_priority = priority
- if smallest_cycle is not None and len(smallest_cycle) == 1:
- # The cycle can't get any smaller than this,
- # so there is no need to search further since
- # we try to minimize ignore_priority.
+ # Exit this loop with the lowest possible priority, which
+ # minimizes the use of installed packages to break cycles.
+ if smallest_cycle is not None:
break
return smallest_cycle, ignore_priority