Skip to content

Commit 9ab3694

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 9ab3694

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

kconfiglib.py

Lines changed: 14 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
@@ -4514,6 +4517,9 @@ class Symbol(object):
45144517
is_constant:
45154518
True if the symbol is a constant (quoted) symbol.
45164519
4520+
is_transitional:
4521+
True if config is in transition to a new name, hide from user
4522+
45174523
kconfig:
45184524
The Kconfig instance this symbol is from.
45194525
"""
@@ -4536,6 +4542,7 @@ class Symbol(object):
45364542
"implies",
45374543
"is_allnoconfig_y",
45384544
"is_constant",
4545+
"is_transitional",
45394546
"kconfig",
45404547
"name",
45414548
"nodes",
@@ -5171,6 +5178,7 @@ def __init__(self):
51715178
# Symbol gets a .config entry.
51725179

51735180
self.is_allnoconfig_y = self._was_set = self._write_to_conf = False
5181+
self.is_transitional = False
51745182

51755183
# See Kconfig._build_dep()
51765184
self._dependents = set()
@@ -5729,6 +5737,9 @@ def __repr__(self):
57295737
if self.is_optional:
57305738
add("optional")
57315739

5740+
if self.is_transitional:
5741+
add("transitional")
5742+
57325743
for node in self.nodes:
57335744
add("{}:{}".format(*node.loc))
57345745

@@ -7555,10 +7566,11 @@ def _rustc_option_fn(kconf, _, option):
75557566
_T_SELECT,
75567567
_T_SOURCE,
75577568
_T_STRING,
7569+
_T_TRANSITIONAL,
75587570
_T_TRISTATE,
75597571
_T_UNEQUAL,
75607572
_T_VISIBLE,
7561-
) = range(1, 51)
7573+
) = range(1, 52)
75627574

75637575
# Keyword to token map, with the get() method assigned directly as a small
75647576
# optimization
@@ -7604,6 +7616,7 @@ def _rustc_option_fn(kconf, _, option):
76047616
"select": _T_SELECT,
76057617
"source": _T_SOURCE,
76067618
"string": _T_STRING,
7619+
"transitional": _T_TRANSITIONAL,
76077620
"tristate": _T_TRISTATE,
76087621
"visible": _T_VISIBLE,
76097622
}.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)