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

binarytree: Fix _inject_repo_revisions to ignore remote packages #1391

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Release notes take the form of the following optional categories:
Bug fixes:
* depgraph: Ignore blockers when computing virtual deps visibility (PR #1387).

* binarytree: Fix _inject_repo_revisions to ignore remote packages for which
source repostories are missing, triggering KeyError (PR #1391).

portage-3.0.66.1 (2024-09-18)
--------------

Expand Down
9 changes: 8 additions & 1 deletion lib/portage/dbapi/bintree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1948,9 +1948,16 @@ def _inject_repo_revisions(self, header, repo_revisions):
package was not built locally, and in this case its
REPO_REVISIONS are not intended to be exposed.
"""
try:
repos = [
self.settings.repositories[repo_name] for repo_name in repo_revisions
]
except KeyError:
# Missing repo implies package was not built locally from source.
return
synced_repo_revisions = get_repo_revision_history(
self.settings["EROOT"],
[self.settings.repositories[repo_name] for repo_name in repo_revisions],
repos,
)
header_repo_revisions = (
json.loads(header["REPO_REVISIONS"]) if header.get("REPO_REVISIONS") else {}
Expand Down