diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-06 17:01:09 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2012-12-06 17:01:29 +0100 |
| commit | c805e3143bada2df897927996ae23a469cf83eb3 (patch) | |
| tree | 38212ced8df505ee2814ac5b8d29460f0fa5e98b /examples/defconfig.py | |
| parent | 94fb111d02b95413f7c36d923dabd4ec1ca1c90e (diff) | |
Move examples into separate directory.
Diffstat (limited to 'examples/defconfig.py')
| -rw-r--r-- | examples/defconfig.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/defconfig.py b/examples/defconfig.py new file mode 100644 index 0000000..3ed09fa --- /dev/null +++ b/examples/defconfig.py @@ -0,0 +1,17 @@ +# Works like entering "make menuconfig" and immediately saving and exiting + +import kconfiglib +import os +import sys + +conf = kconfiglib.Config(sys.argv[1]) + +if os.path.exists(".config"): + conf.load_config(".config") +else: + defconfig = conf.get_defconfig_filename() + if defconfig is not None: + print "Using " + defconfig + conf.load_config(defconfig) + +conf.write_config(".config") |
