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 (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 551B1158020 for ; Wed, 14 Dec 2022 09:24:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 772F6E07A9; Wed, 14 Dec 2022 09:24:11 +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 53566E07A9 for ; Wed, 14 Dec 2022 09:24:11 +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 08A4233BDC5 for ; Wed, 14 Dec 2022 09:24:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 54C894C8 for ; Wed, 14 Dec 2022 09:24:08 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1671009844.d2b36d9abfaed58360bdc0f92d214beb25a94518.sam@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/profile.py X-VCS-Directories: pym/gentoolkit/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d2b36d9abfaed58360bdc0f92d214beb25a94518 X-VCS-Branch: master Date: Wed, 14 Dec 2022 09:24:08 +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: f0d87d00-5553-47f7-b08c-7f917e9adf6e X-Archives-Hash: 381f893f6c8a4e35efa9485c9319bb81 commit: d2b36d9abfaed58360bdc0f92d214beb25a94518 Author: Krzesimir Nowak microsoft com> AuthorDate: Thu Dec 8 15:25:39 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Dec 14 09:24:04 2022 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d2b36d9a profile: Default to main repo name In Flatcar we have a different repo marked as a default one (portage-stable), so "equery keywords" was crashing because it was trying to use gentoo repo anyways. Signed-off-by: Krzesimir Nowak microsoft.com> Closes: https://github.com/gentoo/gentoolkit/pull/24 Signed-off-by: Sam James gentoo.org> pym/gentoolkit/profile.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pym/gentoolkit/profile.py b/pym/gentoolkit/profile.py index f6943be..7469138 100644 --- a/pym/gentoolkit/profile.py +++ b/pym/gentoolkit/profile.py @@ -21,21 +21,26 @@ def warning(msg): print("warning: %s" % msg, file=sys.stderr) -def load_profile_data(portdir=None, repo="gentoo"): +def load_profile_data(portdir=None, repo=""): """Load the list of known arches from the tree Args: portdir: The repository to load all data from (and ignore |repo|) - repo: Look up this repository by name to locate profile data + repo: Look up this repository by name to locate profile data (if empty, uses main repo name) Returns: A dict mapping the keyword to its preferred state: {'x86': ('stable', 'arch'), 'mips': ('dev', '~arch'), ...} """ if portdir is None: - portdir = ( - portage.db[portage.root]["vartree"].settings.repositories[repo].location - ) + repos = portage.db[portage.root]["vartree"].settings.repositories + if repo == "": + main_repo = repos.mainRepo() + if main_repo is None: + repo = "gentoo" + else: + repo = main_repo.name + portdir = repos[repo].location arch_status = {}