mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-01 02:22:11 +02:00
coreos: Add a user patch for app-portage/gentoolkit
Fixes an issue I had when working on package updates automation.
This commit is contained in:
parent
c850639660
commit
545a0b0f36
@ -0,0 +1,53 @@
|
|||||||
|
From e40cd8c76bee4f7c108c1066d60aaf5d8c3adede Mon Sep 17 00:00:00 2001
|
||||||
|
From: Krzesimir Nowak <knowak@microsoft.com>
|
||||||
|
Date: Thu, 8 Dec 2022 16:25:39 +0100
|
||||||
|
Subject: [PATCH] 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 <knowak@microsoft.com>
|
||||||
|
Closes: https://github.com/gentoo/gentoolkit/pull/24
|
||||||
|
Signed-off-by: Sam James <sam@gentoo.org>
|
||||||
|
---
|
||||||
|
pym/gentoolkit/profile.py | 13 ++++++++++---
|
||||||
|
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pym/gentoolkit/profile.py b/pym/gentoolkit/profile.py
|
||||||
|
index dcd02cc..c880137 100644
|
||||||
|
--- a/pym/gentoolkit/profile.py
|
||||||
|
+++ b/pym/gentoolkit/profile.py
|
||||||
|
@@ -23,19 +23,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 = {}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.25.1
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
Drop `0001-profile-Default-to-main-repo-name.patch` when we have gentoolkit 0.6.2 or greater.
|
Loading…
x
Reference in New Issue
Block a user