summaryrefslogtreecommitdiff
path: root/olddefconfig.py
diff options
context:
space:
mode:
Diffstat (limited to 'olddefconfig.py')
-rwxr-xr-xolddefconfig.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/olddefconfig.py b/olddefconfig.py
index 5245735..2845740 100755
--- a/olddefconfig.py
+++ b/olddefconfig.py
@@ -3,10 +3,10 @@
# Copyright (c) 2018, Ulf Magnusson
# SPDX-License-Identifier: ISC
-# Works like 'make olddefconfig', updating an old .config file by filing in
-# default values for all new symbols. This is the same as picking the default
-# selection for all symbols in oldconfig, or entering the menuconfig interface
-# and immediately saving.
+# Works like 'make olddefconfig', updating an old .config file or creating a
+# new one by filing in default values for all new symbols. This is the same as
+# picking the default selection for all symbols in oldconfig, or entering the
+# menuconfig interface and immediately saving.
#
# The default output filename is '.config'. A different filename can be passed
# in the KCONFIG_CONFIG environment variable.
@@ -18,14 +18,9 @@ import kconfiglib
def main():
- config_filename = kconfiglib.standard_config_filename()
- if not os.path.exists(config_filename):
- sys.exit("{}: '{}' not found".format(sys.argv[0], config_filename))
-
kconf = kconfiglib.standard_kconfig()
- kconf.load_config(config_filename)
- kconf.write_config(config_filename)
- print("Updated configuration written to '{}'".format(config_filename))
+ kconf.load_config()
+ kconf.write_config()
if __name__ == "__main__":