aboutsummaryrefslogtreecommitdiffstats
path: root/lib/_emerge/depgraph.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2023-11-18 09:07:59 -0800
committerZac Medico <zmedico@gentoo.org>2023-11-18 20:15:22 -0800
commit9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e (patch)
treea7eda3b9051e1d0ce899ce7f16d6bcf9671d8c52 /lib/_emerge/depgraph.py
parentAdd test case to reproduce bug 917259 (diff)
downloadgentoo-portage-9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e.tar.xz
gentoo-portage-9206d5a75ecd2d9ae0fe63e57d28aa8061b5927e.zip
find_smallest_cycle: Increase ignore_priority to find smaller cycles
Fix AlternativesGzipTestCase by increasing ignore_priority in order to find smaller cycles. This causes some changes in merge order for MergeOrderTestCase, but they appear to be acceptable since they prevent temporarily unsatisfied RDEPEND by relying on satisfied installed build-time dependencies. Add a test case for bug 690436, since the change to merge order in MergeOrderTestCase is related (see commit 680276cc4d4f). Bug: https://bugs.gentoo.org/690436 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, 4 insertions, 3 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index e4305c18c96a..0d3b37c6985a 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -9345,9 +9345,10 @@ class depgraph:
smallest_cycle = selected_nodes
ignore_priority = 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:
+ 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.
break
return smallest_cycle, ignore_priority