diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2019-05-24 12:14:31 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2019-05-24 13:08:12 +0200 |
| commit | e81a77bdb0687b62f91d7dc4d5b84b443808c0a7 (patch) | |
| tree | 339fa0fbd78cafed7e92b230a8931e3ab7a666ee /kconfiglib.py | |
| parent | e806f26a075ba52eca01567c7be7f0b4eba91df5 (diff) | |
Consistently put direct deps. last when propagating
Preparation for some later additions. Previously, the 'visible if' deps
appeared to the right of the 'depends on' deps. Now, the direct deps
always appear last.
With this change, the prompt tuple is only updated once for any given
menu node too, which should be a tiny bit faster.
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 4a58669..2725787 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3321,18 +3321,15 @@ class Kconfig(object): cur = node.list while cur: - cur.dep = dep = self._make_and(cur.dep, basedep) - - # Propagate dependencies to prompt - if cur.prompt: - cur.prompt = (cur.prompt[0], - self._make_and(cur.prompt[1], dep)) + dep = cur.dep = self._make_and(cur.dep, basedep) if cur.item.__class__ in _SYMBOL_CHOICE: - # Propagate 'visible if' dependencies to the prompt if cur.prompt: + # Propagate 'visible if' and dependencies to the prompt cur.prompt = (cur.prompt[0], - self._make_and(cur.prompt[1], visible_if)) + self._make_and( + cur.prompt[1], + self._make_and(visible_if, dep))) # Propagate dependencies to defaults if cur.defaults: @@ -3354,6 +3351,11 @@ class Kconfig(object): cur.implies = [(target, self._make_and(cond, dep)) for target, cond in cur.implies] + elif cur.prompt: # Not a symbol/choice + # Propagate dependencies to the prompt. 'visible if' is only + # propagated to symbols/choices. + cur.prompt = (cur.prompt[0], + self._make_and(cur.prompt[1], dep)) cur = cur.next |
