summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut.grohne@intenta.de>2022-04-21 10:07:53 +0200
committerTorsten Tejlmand Rasmussen <torsten.rasmussen@nordicsemi.no>2025-10-21 10:43:54 +0200
commit82fdbdac5aab969853fe15ee7ad0c24a3fe72b0d (patch)
treefaee8d85bad5e00834b9f215a5434046a7a0a806
parentd127618797be49aa99271df6fa6cd93c533c89ab (diff)
Add rudimentary support for modules property
In linux commit 6dd85ff178cd76851e2184b13e545f5a88d1be30, Linux Torvalds changed "option modules" to plain "modules" since it was the only option left. kconfiglib does not have much support for either besides parsing it and suppressing warnings when it is applied to the 'MODULES' symbol. Mirror this behaviour for the newer "modules" property. Fixes: #106
-rw-r--r--kconfiglib.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 2c788c9..77f35e4 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -3257,6 +3257,20 @@ class Kconfig(object):
else:
self._parse_error("unrecognized option")
+ elif t0 is _T_MODULES:
+ # 'modules' formerly was 'option modules'. See above for why
+ # and when it is ignored. It was changed in
+ # linux commit 6dd85ff178cd76851e2184b13e545f5a88d1be30.
+ if node.item is not self.modules:
+ self._warn("the 'modules' property is not supported. Let "
+ "me know if this is a problem for you, as it "
+ "wouldn't be that hard to implement. Note that "
+ "modules are supported -- Kconfiglib just "
+ "assumes the symbol name MODULES, like older "
+ "versions of the C implementation did when "
+ "'modules' wasn't used.",
+ self.filename, self.linenr)
+
elif t0 is _T_OPTIONAL:
if node.item.__class__ is not Choice:
self._parse_error('"optional" is only valid for choices')