Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a depgraph crash with useoldpkg and subslot bumps #1322

Closed
wants to merge 1 commit into from

Conversation

ishitatsuyuki
Copy link
Contributor

This resolves a "list index out of range" error that could happen with when a package's subslot is bumped and --useoldpkg is used. (We countered this in a ChromeOS uprev.)

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.

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>
@@ -8177,6 +8177,7 @@ def _wrapped_select_pkg_highest_available_imp(
):
return pkg, existing_node

matched_oldpkg = [x for x in matched_oldpkg if x in matched_packages]
visible_matches = []
if matched_oldpkg:
visible_matches = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the logic that follows is only valid when matched_oldpkg is a subset of matched_packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants