aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kconfiglib/olddefconfig.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-11-18 20:26:58 -0500
committerKevin O'Connor <kevin@koconnor.net>2020-11-23 10:17:48 -0500
commit0d5b05c704d1e15de2ce075f70d0de9f29ba1386 (patch)
tree72f50692a748e09e0aa9942b502d8a2210c4d1fc /lib/kconfiglib/olddefconfig.py
parent665ec5e9877ec56c93fb519f069a6c932dbe91a9 (diff)
downloadkutter-0d5b05c704d1e15de2ce075f70d0de9f29ba1386.tar.gz
kutter-0d5b05c704d1e15de2ce075f70d0de9f29ba1386.tar.xz
kutter-0d5b05c704d1e15de2ce075f70d0de9f29ba1386.zip
lib: Add kconfiglib code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'lib/kconfiglib/olddefconfig.py')
-rwxr-xr-xlib/kconfiglib/olddefconfig.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/kconfiglib/olddefconfig.py b/lib/kconfiglib/olddefconfig.py
new file mode 100755
index 00000000..2dadfb41
--- /dev/null
+++ b/lib/kconfiglib/olddefconfig.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+
+# Copyright (c) 2018-2019, Ulf Magnusson
+# SPDX-License-Identifier: ISC
+
+"""
+Updates an old .config file or creates a new one, by filling 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 input/output filename is '.config'. A different filename can be
+passed in the KCONFIG_CONFIG environment variable.
+
+When overwriting a configuration file, the old version is saved to
+<filename>.old (e.g. .config.old).
+"""
+import kconfiglib
+
+
+def main():
+ kconf = kconfiglib.standard_kconfig(__doc__)
+ print(kconf.load_config())
+ print(kconf.write_config())
+
+
+if __name__ == "__main__":
+ main()