aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-07-24 18:07:45 +0200
committerKarel Kočí <cynerd@email.cz>2015-07-24 18:07:45 +0200
commitb6e75b3c98e9092a14a1a8d7142f43bb4cebc454 (patch)
treeb0abc0262379a53d1e49b9c23ded8458a9af12a3
parentbcfac3d31b96eb783667eb6683f953ae808c5ea9 (diff)
downloadlinux-conf-perf-b6e75b3c98e9092a14a1a8d7142f43bb4cebc454.tar.gz
linux-conf-perf-b6e75b3c98e9092a14a1a8d7142f43bb4cebc454.tar.bz2
linux-conf-perf-b6e75b3c98e9092a14a1a8d7142f43bb4cebc454.zip
kernel.config rewritten to use utils.callsubprocess and support new implementation of write_config
Also unused function config_noprogram commented.
-rw-r--r--scripts/kernel.py40
1 files changed, 18 insertions, 22 deletions
diff --git a/scripts/kernel.py b/scripts/kernel.py
index 372e111..bfa1c50 100644
--- a/scripts/kernel.py
+++ b/scripts/kernel.py
@@ -7,33 +7,29 @@ from conf import sf
import exceptions
import utils
-def config():
- env = dict(os.environ)
+def config(cfile):
wd = os.getcwd()
+ infile = os.path.join(sf(conf.configurations_folder), cfile)
os.chdir(sf(conf.linux_sources))
- if conf.kernel_config_output:
- sprc = subprocess.call([sf(conf.write_config), sf(conf.linux_kconfig_head),
- sf(conf.build_folder)], env=utils.get_kernel_env())
- else:
- sprc = subprocess.call([sf(conf.write_config), sf(conf.linux_kconfig_head),
- sf(conf.build_folder)], stdout=subprocess.DEVNULL,
- env=utils.get_kernel_env())
- if sprc > 0:
+ try:
+ utils.callsubprocess('write_config', [sf(conf.write_config), infile],
+ conf.kernel_config_output, env=utils.get_kernel_env())
+ except exceptions.ProcessFailed:
raise exceptions.ConfigurationError("some configs mismatch")
os.chdir(wd)
-def config_noprogram():
- # Executing old linux config
- env = dict(os.environ)
- wd = os.getcwd()
- os.chdir(sf(conf.linux_sources))
- if conf.kernel_config_output:
- sprc = subprocess.call('yes "" | make oldconfig', shell=True,
- env=utils.get_kernel_env())
- else:
- sprc = subprocess.call('yes "" | make oldconfig', shell=True,
- stdout=subprocess.DEVNULL, env=utils.get_kernel_env())
- os.chdir(wd)
+#def config_noprogram():
+# # Executing old linux config
+# env = dict(os.environ)
+# wd = os.getcwd()
+# os.chdir(sf(conf.linux_sources))
+# if conf.kernel_config_output:
+# sprc = subprocess.call('yes "" | make oldconfig', shell=True,
+# env=utils.get_kernel_env())
+# else:
+# sprc = subprocess.call('yes "" | make oldconfig', shell=True,
+# stdout=subprocess.DEVNULL, env=utils.get_kernel_env())
+# os.chdir(wd)
def make():
wd = os.getcwd()