From f9b158ebb3d81c923461981d2b087989c284c2d4 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Wed, 30 May 2018 21:18:49 +0200 Subject: Add tool helper for loading/saving .config files Removes repeated KCONFIG_CONFIG boilerplate. Also make allyesconfig use KCONFIG_CONFIG when writing (oversight), and document the sys.exit() behavior for standard_kconfig(). --- oldconfig.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'oldconfig.py') diff --git a/oldconfig.py b/oldconfig.py index 70a3f5f..546da02 100755 --- a/oldconfig.py +++ b/oldconfig.py @@ -101,7 +101,7 @@ # Configuration written to .config from __future__ import print_function from kconfiglib import Kconfig, Symbol, Choice, BOOL, TRISTATE, HEX, \ - standard_kconfig + standard_kconfig, standard_config_filename import os import sys @@ -302,10 +302,7 @@ def do_oldconfig_for_node(node): def main(): kconf = standard_kconfig() - config_filename = os.environ.get("KCONFIG_CONFIG") - if config_filename is None: - config_filename = ".config" - + config_filename = standard_config_filename() if not os.path.exists(config_filename): sys.exit("{}: '{}' does not exist" .format(sys.argv[0], config_filename)) -- cgit v1.2.3