Gentoo Archives: gentoo-catalyst

From: Matt Turner <mattst88@g.o>
To: gentoo-catalyst@l.g.o
Cc: Matt Turner <mattst88@g.o>
Subject: [gentoo-catalyst] [PATCH 16/21] catalyst: Don't even try to make envars from dicts
Date: Wed, 20 May 2020 03:43:15
Message-Id: 20200520034226.2870937-16-mattst88@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 01/21] targets: Remove copy_{file,symlink,lib} functions by Matt Turner
1 With the removal of the arch modules (presumably), the two exceptions
2 (compress_definitions and decompress_definitions) are the only dicts in
3 self.settings.
4
5 Signed-off-by: Matt Turner <mattst88@g.o>
6 ---
7 catalyst/base/stagebase.py | 22 ++--------------------
8 1 file changed, 2 insertions(+), 20 deletions(-)
9
10 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
11 index 9410f151..8e2b08da 100644
12 --- a/catalyst/base/stagebase.py
13 +++ b/catalyst/base/stagebase.py
14 @@ -1285,28 +1285,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
15 self.env[varname] = "true"
16 else:
17 self.env[varname] = "false"
18 - # This handles a dictionary of objects just one level deep and no deeper!
19 - # Its currently used only for USE_EXPAND flags which are dictionaries of
20 - # lists in arch/amd64.py and friends. If we wanted self.settigs[var]
21 - # of any depth, we should make this function recursive.
22 elif isinstance(self.settings[x], dict):
23 - if x in ["compress_definitions",
24 - "decompress_definitions"]:
25 + if x in ['compress_definitions', 'decompress_definitions']:
26 continue
27 - self.env[varname] = ' '.join(self.settings[x].keys())
28 - for y in self.settings[x].keys():
29 - varname2 = "clst_" + y.replace("/", "_")
30 - varname2 = varname2.replace("-", "_")
31 - varname2 = varname2.replace(".", "_")
32 - if isinstance(self.settings[x][y], str):
33 - self.env[varname2] = self.settings[x][y]
34 - elif isinstance(self.settings[x][y], list):
35 - self.env[varname2] = ' '.join(self.settings[x][y])
36 - elif isinstance(self.settings[x][y], bool):
37 - if self.settings[x][y]:
38 - self.env[varname] = "true"
39 - else:
40 - self.env[varname] = "false"
41 + log.warning("Not making envar for '%s', is a dict", x)
42
43 if "makeopts" in self.settings:
44 if isinstance(self.settings["makeopts"], str):
45 --
46 2.26.2