summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/allnoconfig_walk.py2
-rw-r--r--examples/defconfig.py23
-rw-r--r--examples/defconfig_oldconfig.py10
3 files changed, 6 insertions, 29 deletions
diff --git a/examples/allnoconfig_walk.py b/examples/allnoconfig_walk.py
index 227effd..5abc80c 100644
--- a/examples/allnoconfig_walk.py
+++ b/examples/allnoconfig_walk.py
@@ -61,4 +61,4 @@ while True:
if not changed:
break
-kconf.write_config(".config")
+kconf.write_config()
diff --git a/examples/defconfig.py b/examples/defconfig.py
deleted file mode 100644
index c9cc7c6..0000000
--- a/examples/defconfig.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Works like entering "make menuconfig" and immediately saving and exiting
-#
-# Usage:
-#
-# $ make [ARCH=<arch>] scriptconfig SCRIPT=Kconfiglib/examples/allyesconfig.py
-
-import os
-import sys
-
-import kconfiglib
-
-
-kconf = kconfiglib.Kconfig(sys.argv[1])
-
-if os.path.exists(".config"):
- print("using existing .config")
- kconf.load_config(".config")
-elif kconf.defconfig_filename is not None:
- print("using " + kconf.defconfig_filename)
- kconf.load_config(kconf.defconfig_filename)
-
-kconf.write_config(".config")
-print("configuration written to .config")
diff --git a/examples/defconfig_oldconfig.py b/examples/defconfig_oldconfig.py
index 0b24e1d..98f97a0 100644
--- a/examples/defconfig_oldconfig.py
+++ b/examples/defconfig_oldconfig.py
@@ -21,19 +21,19 @@ kconf = kconfiglib.Kconfig(sys.argv[1])
# Mirrors defconfig
kconf.load_config("arch/x86/configs/x86_64_defconfig")
-kconf.write_config(".config")
+kconf.write_config()
# Mirrors the first oldconfig
-kconf.load_config(".config")
+kconf.load_config()
kconf.syms["ETHERNET"].set_value(0)
-kconf.write_config(".config")
+kconf.write_config()
# Mirrors the second oldconfig
-kconf.load_config(".config")
+kconf.load_config()
kconf.syms["ETHERNET"].set_value(2)
for s in kconf.unique_defined_syms:
if s.user_value is None and 0 in s.assignable:
s.set_value(0)
# Write the final configuration
-kconf.write_config(".config")
+kconf.write_config()