Skip to content

Commit 82fdbda

Browse files
Helmut Grohnetejlmand
authored andcommitted
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
1 parent d127618 commit 82fdbda

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

kconfiglib.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3257,6 +3257,20 @@ def _parse_props(self, node):
32573257
else:
32583258
self._parse_error("unrecognized option")
32593259

3260+
elif t0 is _T_MODULES:
3261+
# 'modules' formerly was 'option modules'. See above for why
3262+
# and when it is ignored. It was changed in
3263+
# linux commit 6dd85ff178cd76851e2184b13e545f5a88d1be30.
3264+
if node.item is not self.modules:
3265+
self._warn("the 'modules' property is not supported. Let "
3266+
"me know if this is a problem for you, as it "
3267+
"wouldn't be that hard to implement. Note that "
3268+
"modules are supported -- Kconfiglib just "
3269+
"assumes the symbol name MODULES, like older "
3270+
"versions of the C implementation did when "
3271+
"'modules' wasn't used.",
3272+
self.filename, self.linenr)
3273+
32603274
elif t0 is _T_OPTIONAL:
32613275
if node.item.__class__ is not Choice:
32623276
self._parse_error('"optional" is only valid for choices')

0 commit comments

Comments
 (0)