From d3bfbfeb17755aa20dba77eee1342b82acb11d1d Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 24 Apr 2018 11:41:47 +0200 Subject: [PATCH] kconfiglib: Update to get choice.direct_dep in Update Kconfiglib to upstream revision 509e374dfcadb (+ local Zephyr modifications) to get commit 509e374dfcadb ("Add Choice.direct_dep field") in. It is used by the upcoming Python menuconfig implementation when displaying information about choices. Origin: https://github.com/zephyrproject-rtos/Kconfiglib/tree/zephyr Signed-off-by: Ulf Magnusson --- scripts/kconfig/kconfiglib.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/kconfig/kconfiglib.py b/scripts/kconfig/kconfiglib.py index 973d8818f3..6f979ac69e 100644 --- a/scripts/kconfig/kconfiglib.py +++ b/scripts/kconfig/kconfiglib.py @@ -1964,14 +1964,18 @@ class Kconfig(object): name = self._next_token() if name is None: choice = Choice() + choice.direct_dep = self.n + self._choices.append(choice) else: # Named choice choice = self.named_choices.get(name) if not choice: choice = Choice() - self._choices.append(choice) choice.name = name + choice.direct_dep = self.n + + self._choices.append(choice) self.named_choices[name] = choice choice.kconfig = self @@ -2267,10 +2271,9 @@ class Kconfig(object): else node.parent.dep) if isinstance(node.item, (Symbol, Choice)): - if isinstance(node.item, Symbol): - # See the class documentation - node.item.direct_dep = \ - self._make_or(node.item.direct_dep, node.dep) + # See the Symbol/Choice class documentation + node.item.direct_dep = \ + self._make_or(node.item.direct_dep, node.dep) # Set the prompt, with dependencies propagated if node.prompt: @@ -3548,6 +3551,9 @@ class Choice(object): Note that 'depends on' and parent dependencies are propagated to 'default' conditions. + direct_dep: + See Symbol.direct_dep. + is_optional: True if the choice has the 'optional' flag set on it and can be in n mode. @@ -3562,6 +3568,7 @@ class Choice(object): "_dependents", "_was_set", "defaults", + "direct_dep", "is_constant", "is_optional", "kconfig", @@ -3759,6 +3766,7 @@ class Choice(object): """ # These attributes are always set on the instance from outside and # don't need defaults: + # direct_dep # kconfig self.orig_type = UNKNOWN