From dd0e227216e247d2040cdd40bf7397702880cdc4 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Mon, 9 Oct 2017 23:05:00 +0200 Subject: Kconfiglib 2 backup WIP --- examples/defconfig.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'examples/defconfig.py') diff --git a/examples/defconfig.py b/examples/defconfig.py index 3e958e2..ce2bf6e 100644 --- a/examples/defconfig.py +++ b/examples/defconfig.py @@ -1,4 +1,8 @@ # Works like entering "make menuconfig" and immediately saving and exiting +# +# Usage: +# +# $ make [ARCH=] scriptconfig SCRIPT=Kconfiglib/examples/allyesconfig.py import kconfiglib import os @@ -7,11 +11,12 @@ import sys conf = kconfiglib.Config(sys.argv[1]) if os.path.exists(".config"): + print("using existing .config") conf.load_config(".config") else: - defconfig = conf.get_defconfig_filename() - if defconfig is not None: - print("Using" + defconfig) - conf.load_config(defconfig) + if conf.defconfig_filename is not None: + print("using " + conf.defconfig_filename) + conf.load_config(conf.defconfig_filename) conf.write_config(".config") +print("configuration written to .config") -- cgit v1.2.3