From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 17160158042 for ; Sun, 27 Oct 2024 23:14:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 574C8E0855; Sun, 27 Oct 2024 23:13:59 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 33310E0855 for ; Sun, 27 Oct 2024 23:13:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 304D7342FE4 for ; Sun, 27 Oct 2024 23:13:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8C1771295 for ; Sun, 27 Oct 2024 23:13:56 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1730070789.cc6a6b08938809bcfa4a244ab5050fd3b496807f.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: /, lib/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: NEWS lib/portage/dbapi/bintree.py X-VCS-Directories: lib/portage/dbapi/ / X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: cc6a6b08938809bcfa4a244ab5050fd3b496807f X-VCS-Branch: master Date: Sun, 27 Oct 2024 23:13:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9c281650-487a-47ad-a0fe-9b32e422343f X-Archives-Hash: 3f005e8c2d5b7d65c661c16eb8b19293 commit: cc6a6b08938809bcfa4a244ab5050fd3b496807f Author: Zac Medico gentoo org> AuthorDate: Fri Oct 25 19:59:38 2024 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Oct 27 23:13:09 2024 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cc6a6b08 binarytree: Fix _inject_repo_revisions to ignore remote packages For remote packages that reference source repos which do not exist locally, do not inject repo revisions. Fixes: 5aed7289d516 ("bintree: Add REPO_REVISIONS to package index header") Bug: https://bugs.gentoo.org/939299 Signed-off-by: Zac Medico gentoo.org> NEWS | 3 +++ lib/portage/dbapi/bintree.py | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 110fea45ab..5c1cea5c27 100644 --- a/NEWS +++ b/NEWS @@ -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) -------------- diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py index 6099bab968..a63652c7e0 100644 --- a/lib/portage/dbapi/bintree.py +++ b/lib/portage/dbapi/bintree.py @@ -1948,9 +1948,16 @@ class binarytree: 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 {}