summaryrefslogtreecommitdiff
path: root/menuconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-05-27 18:09:41 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-05-27 18:12:35 +0200
commit02f7330b450faf99716dbc7eefe3d6d2bdba0253 (patch)
tree3f398946d8d9f31e26683388e192b46715d9ec64 /menuconfig.py
parent5b2eebea674012bd4ca6b965c901e8868375b778 (diff)
menuconfig: Always prompt for save when output file is missing
An output file should still be generated if you're happy with the default settings.
Diffstat (limited to 'menuconfig.py')
-rwxr-xr-xmenuconfig.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/menuconfig.py b/menuconfig.py
index 781654c..8ad3d94 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -298,6 +298,7 @@ def menuconfig(kconf):
globals()["_kconf"] = kconf
global _config_filename
global _show_all
+ global _conf_changed
_config_filename = os.environ.get("KCONFIG_CONFIG")
@@ -306,17 +307,22 @@ def menuconfig(kconf):
if os.path.exists(_config_filename):
+ _conf_changed = False
print("Using existing configuration '{}' as base"
.format(_config_filename))
_kconf.load_config(_config_filename)
- elif kconf.defconfig_filename is not None:
- print("Using default configuration found in '{}' as base"
- .format(kconf.defconfig_filename))
- _kconf.load_config(kconf.defconfig_filename)
-
else:
- print("Using default symbol values as base")
+ # Always prompt for save if the output configuration file doesn't exist
+ _conf_changed = True
+
+ if kconf.defconfig_filename is not None:
+ print("Using default configuration found in '{}' as base"
+ .format(kconf.defconfig_filename))
+ _kconf.load_config(kconf.defconfig_filename)
+
+ else:
+ print("Using default symbol values as base")
# Any visible items in the top menu?
@@ -562,8 +568,6 @@ def _init():
global _show_name
- global _conf_changed
-
# Looking for this in addition to KEY_BACKSPACE (which is unreliable) makes
# backspace work with TERM=vt100. That makes it likely to work in sane
# environments.
@@ -611,9 +615,6 @@ def _init():
# Give windows their initial size
_resize_main()
- # No changes yet
- _conf_changed = False
-
def _resize_main():
# Resizes the main display, with the list of symbols, etc., to fill the
# terminal