summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Bier <Felix.Bier@rohde-schwarz.com>2020-10-14 13:38:21 +0000
committerMatt Turner <mattst88@gentoo.org>2020-10-14 10:50:09 -0700
commite82e550b1b8d0d73673d8cbf701d0c76537f4525 (patch)
tree949be02847b28e1fb463902b7eb070266f012449
parentcatalyst: Fix typo (diff)
downloadcatalyst-e82e550b1b8d0d73673d8cbf701d0c76537f4525.tar.gz
catalyst-e82e550b1b8d0d73673d8cbf701d0c76537f4525.tar.bz2
catalyst-e82e550b1b8d0d73673d8cbf701d0c76537f4525.zip
catalyst: Fix spec file USE flag parsing
In stagebase, the set_use function applies .split() to the use flags passed from the spec file, if the value is a string. However, the result is immediately overwritten after the if-statement. Therefore the .split() is ineffectual. This results in self.settings["use"] holding a string, which is then regarded as a list of characters in write_make_conf. This fix ensures that the result of the split is not overwritten (matching the similar code in set_catalyst_use). For example, setting "stage4/use: abc" in a spec file results in USE="a b c ..." in the generated make.conf. With this fix, the generated make.conf contains the expected USE="abc ...". Fixes: b30dd97d ("Unify all make.conf settings and writing") Signed-off-by: Matt Turner <mattst88@gentoo.org> (cherry picked from commit 5d01bda685236a8543da3a8136a4fe809f6fd9ae)
-rw-r--r--catalyst/base/stagebase.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 0cf3495a..bb8f29da 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -571,7 +571,8 @@ class StageBase(TargetBase, ClearBase, GenBase):
if use in self.settings:
if isinstance(self.settings[use], str):
self.settings["use"] = self.settings[use].split()
- self.settings["use"] = self.settings[use]
+ else:
+ self.settings["use"] = self.settings[use]
del self.settings[use]
else:
self.settings["use"] = []