aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kconfiglib/kconfiglib.patch
blob: ffe6f0411f4473c55cb681b50095007814f79dfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
diff --git a/lib/kconfiglib/kconfiglib.py b/lib/kconfiglib/kconfiglib.py
index c67895ce..fb5e4b76 100644
--- a/lib/kconfiglib/kconfiglib.py
+++ b/lib/kconfiglib/kconfiglib.py
@@ -1475,8 +1475,8 @@ class Kconfig(object):
             # instead, to avoid accessing the internal _write_to_conf variable
             # (though it's likely to keep working).
             val = sym.str_value
-            if not sym._write_to_conf:
-                continue
+            #if not sym._write_to_conf:
+            #    continue
 
             if sym.orig_type in _BOOL_TRISTATE:
                 if val == "y":
@@ -1485,6 +1485,9 @@ class Kconfig(object):
                 elif val == "m":
                     add("#define {}{}_MODULE 1\n"
                         .format(self.config_prefix, sym.name))
+                else:
+                    add("#define {}{} 0\n"
+                        .format(self.config_prefix, sym.name))
 
             elif sym.orig_type is STRING:
                 add('#define {}{} "{}"\n'
@@ -1494,6 +1497,8 @@ class Kconfig(object):
                 if sym.orig_type is HEX and \
                    not val.startswith(("0x", "0X")):
                     val = "0x" + val
+                if not val:
+                    val = "0"
 
                 add("#define {}{} {}\n"
                     .format(self.config_prefix, sym.name, val))
diff --git a/lib/kconfiglib/menuconfig.py b/lib/kconfiglib/menuconfig.py
index 7e765d36..900d88a1 100755
--- a/lib/kconfiglib/menuconfig.py
+++ b/lib/kconfiglib/menuconfig.py
@@ -259,10 +259,8 @@ _N_SCROLL_ARROWS = 14
 
 # Lines of help text shown at the bottom of the "main" display
 _MAIN_HELP_LINES = """
-[Space/Enter] Toggle/enter  [ESC] Leave menu           [S] Save
-[O] Load                    [?] Symbol info            [/] Jump to symbol
-[F] Toggle show-help mode   [C] Toggle show-name mode  [A] Toggle show-all mode
-[Q] Quit (prompts for save) [D] Save minimal config (advanced)
+[Space/Enter] Toggle/enter      [?] Help            [/] Search
+[Q] Quit (prompts for save)     [ESC] Leave menu
 """[1:-1].split("\n")
 
 # Lines of help text shown at the bottom of the information dialog
@@ -890,17 +888,17 @@ def _menuconfig(stdscr):
             else:
                 _leave_menu()
 
-        elif c in ("o", "O"):
+        elif 0 and c in ("o", "O"):
             _load_dialog()
 
-        elif c in ("s", "S"):
+        elif 0 and c in ("s", "S"):
             filename = _save_dialog(_kconf.write_config, _conf_filename,
                                     "configuration")
             if filename:
                 _conf_filename = filename
                 _conf_changed = False
 
-        elif c in ("d", "D"):
+        elif 0 and c in ("d", "D"):
             filename = _save_dialog(_kconf.write_min_config, _minconf_filename,
                                     "minimal configuration")
             if filename:
@@ -918,15 +916,15 @@ def _menuconfig(stdscr):
             # dialog was open
             _resize_main()
 
-        elif c in ("f", "F"):
+        elif 0 and c in ("f", "F"):
             _show_help = not _show_help
             _set_style(_help_win, "show-help" if _show_help else "help")
             _resize_main()
 
-        elif c in ("c", "C"):
+        elif 0 and c in ("c", "C"):
             _show_name = not _show_name
 
-        elif c in ("a", "A"):
+        elif 0 and c in ("a", "A"):
             _toggle_show_all()
 
         elif c in ("q", "Q"):
@@ -2552,11 +2550,11 @@ def _info_str(node):
             _prompt_info(sym) +
             "Type: {}\n".format(TYPE_TO_STR[sym.type]) +
             _value_info(sym) +
-            _help_info(sym) +
-            _direct_dep_info(sym) +
-            _defaults_info(sym) +
-            _select_imply_info(sym) +
-            _kconfig_def_info(sym)
+            _help_info(sym)
+            #_direct_dep_info(sym) +
+            #_defaults_info(sym) +
+            #_select_imply_info(sym) +
+            #_kconfig_def_info(sym)
         )
 
     if isinstance(node.item, Choice):
@@ -2568,10 +2566,10 @@ def _info_str(node):
             "Type: {}\n".format(TYPE_TO_STR[choice.type]) +
             'Mode: {}\n'.format(choice.str_value) +
             _help_info(choice) +
-            _choice_syms_info(choice) +
-            _direct_dep_info(choice) +
-            _defaults_info(choice) +
-            _kconfig_def_info(choice)
+            _choice_syms_info(choice)
+            #_direct_dep_info(choice) +
+            #_defaults_info(choice) +
+            #_kconfig_def_info(choice)
         )
 
     return _kconfig_def_info(node)  # node.item in (MENU, COMMENT)
@@ -2588,10 +2586,12 @@ def _prompt_info(sc):
     # Returns a string listing the prompts of 'sc' (Symbol or Choice)
 
     s = ""
+    found = []
 
     for node in sc.nodes:
-        if node.prompt:
+        if node.prompt and node.prompt[0] not in found:
             s += "Prompt: {}\n".format(node.prompt[0])
+            found.append(node.prompt[0])
 
     return s
 
@@ -2632,6 +2632,9 @@ def _help_info(sc):
         if node.help is not None:
             s += "Help:\n\n{}\n\n".format(_indent(node.help, 2))
 
+    if s == "\n":
+        s = "\nHelp: (No help available)\n\n"
+
     return s