Skip to content

Commit ea56f20

Browse files
committed
add transitional symbol attribute for migration support
added in 6.17 with f9afce4f32e9 Signed-off-by: Ulrich Weber <[email protected]>
1 parent 1701543 commit ea56f20

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

kconfiglib.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3462,6 +3462,9 @@ def _parse_props(self, node):
34623462

34633463
node.item.is_optional = True
34643464

3465+
elif t0 is _T_TRANSITIONAL:
3466+
node.item.is_transitional = True
3467+
34653468
else:
34663469
# Reuse the tokens for the non-property line later
34673470
self._reuse_tokens = True
@@ -5520,6 +5523,9 @@ class Choice(object):
55205523
True if the choice has the 'optional' flag set on it and can be in
55215524
n mode.
55225525
5526+
is_transitional:
5527+
True if config is in transition to a new name, hide from user
5528+
55235529
kconfig:
55245530
The Kconfig instance this choice is from.
55255531
"""
@@ -5536,6 +5542,7 @@ class Choice(object):
55365542
"direct_dep",
55375543
"is_constant",
55385544
"is_optional",
5545+
"is_transitional",
55395546
"kconfig",
55405547
"name",
55415548
"nodes",
@@ -5729,6 +5736,9 @@ def __repr__(self):
57295736
if self.is_optional:
57305737
add("optional")
57315738

5739+
if self.is_transitional:
5740+
add("transitional")
5741+
57325742
for node in self.nodes:
57335743
add("{}:{}".format(*node.loc))
57345744

@@ -7555,10 +7565,11 @@ def _rustc_option_fn(kconf, _, option):
75557565
_T_SELECT,
75567566
_T_SOURCE,
75577567
_T_STRING,
7568+
_T_TRANSITIONAL,
75587569
_T_TRISTATE,
75597570
_T_UNEQUAL,
75607571
_T_VISIBLE,
7561-
) = range(1, 51)
7572+
) = range(1, 52)
75627573

75637574
# Keyword to token map, with the get() method assigned directly as a small
75647575
# optimization
@@ -7604,6 +7615,7 @@ def _rustc_option_fn(kconf, _, option):
76047615
"select": _T_SELECT,
76057616
"source": _T_SOURCE,
76067617
"string": _T_STRING,
7618+
"transitional": _T_TRANSITIONAL,
76077619
"tristate": _T_TRISTATE,
76087620
"visible": _T_VISIBLE,
76097621
}.get

tests/Kreferenced

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ config JUST_DEPENDS_ON_REFS
55
bool
66
depends on A && B
77

8+
config FEATURE
9+
bool
10+
default FEATURE_OLD
11+
12+
config FEATURE_OLD
13+
bool
14+
transitional
15+
816
if A
917

1018
menu "menu"

0 commit comments

Comments
 (0)