Skip to content

Commit afa41c9

Browse files
committed
add transitional symbol attribute for migration support
added in 6.17 with f9afce4f32e9 Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>
1 parent 1701543 commit afa41c9

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",
@@ -5101,6 +5108,9 @@ def __repr__(self):
51015108
if self is self.kconfig.modules:
51025109
add("is the modules symbol")
51035110

5111+
if self.is_transitional:
5112+
add("transitional")
5113+
51045114
add("direct deps " + TRI_TO_STR[expr_value(self.direct_dep)])
51055115

51065116
if self.nodes:
@@ -5171,6 +5181,7 @@ def __init__(self):
51715181
# Symbol gets a .config entry.
51725182

51735183
self.is_allnoconfig_y = self._was_set = self._write_to_conf = False
5184+
self.is_transitional = False
51745185

51755186
# See Kconfig._build_dep()
51765187
self._dependents = set()
@@ -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 TRANSITIONAL
9+
bool
10+
default TRANSITIONAL_LEGACY_NAME
11+
12+
config TRANSITIONAL_LEGACY_NAME
13+
bool
14+
transitional
15+
816
if A
917

1018
menu "menu"

0 commit comments

Comments
 (0)