aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuyuki Ishi <ishitatsuyuki@google.com>2024-05-15 16:46:36 +0900
committerZac Medico <zmedico@gentoo.org>2024-05-26 11:01:22 -0700
commit685908978c48f6bfeab99f47ba7d78ee00294a64 (patch)
tree1842ca178f9c15bb6c714433c35af0ef197f4ca7
parentbintree: Add REPO_REVISIONS to package index header (diff)
downloadportage-685908978c48f6bfeab99f47ba7d78ee00294a64.tar.gz
portage-685908978c48f6bfeab99f47ba7d78ee00294a64.tar.bz2
portage-685908978c48f6bfeab99f47ba7d78ee00294a64.zip
Fix a depgraph crash with useoldpkg and subslot bumps
This resolves a "list index out of range" error that could happen with when a package's subslot is bumped and --useoldpkg is used. Due to the subslot bump, the code will filter matched_packages to only contain the latest version. However, this didn't update matched_oldpkg, which would now contain stale packages and cause logic errors. Fix this by filtering matched_oldpkg again before its use. Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@google.com> Bug: https://bugs.gentoo.org/932804 Closes: https://github.com/gentoo/portage/pull/1322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/_emerge/depgraph.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 13add990e..6b91d5c42 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -8177,6 +8177,7 @@ class depgraph:
):
return pkg, existing_node
+ matched_oldpkg = [x for x in matched_oldpkg if x in matched_packages]
visible_matches = []
if matched_oldpkg:
visible_matches = [