aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-03-24 23:15:28 +0100
committerKarel Kočí <cynerd@email.cz>2015-03-24 23:15:28 +0100
commit959aeeca3891d1f21d009e84464d6ac4f2a60816 (patch)
treeeb168ba568d62149025ffeca86d8c1188ed02655
parent158653da512d7ace39e3cacc796e95ad8a4bbaab (diff)
downloadlinux-conf-perf-959aeeca3891d1f21d009e84464d6ac4f2a60816.tar.gz
linux-conf-perf-959aeeca3891d1f21d009e84464d6ac4f2a60816.tar.bz2
linux-conf-perf-959aeeca3891d1f21d009e84464d6ac4f2a60816.zip
Add source .config backup
-rw-r--r--conf.py3
-rw-r--r--scripts/initialize.py5
-rw-r--r--scripts/solution.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/conf.py b/conf.py
index e78e427..3c69ee0 100644
--- a/conf.py
+++ b/conf.py
@@ -26,7 +26,8 @@ symbol_map_file = build_folder + '/symbol_map' # Also defined in kconfig_parser
rules_file = build_folder + '/rules' # Also defined in kconfig_parser
solved_file = build_folder + '/solved'
required_file = build_folder + '/required'
-dot_config_file = build_folder + '/dot_config'
+dot_config_fragment_file = build_folder + '/dot_config_fragment'
+dot_config_back_file = build_folder + '/dot_config_back'
solution_file = build_folder + '/solution'
iteration_file = build_folder + '/iteration'
diff --git a/scripts/initialize.py b/scripts/initialize.py
index 2fc7d54..951834a 100644
--- a/scripts/initialize.py
+++ b/scripts/initialize.py
@@ -1,6 +1,7 @@
import os
import sys
import subprocess
+import shutil
import utils
from conf import conf
@@ -32,9 +33,11 @@ def gen_requred():
except OSError:
pass
+ shutil.copy(conf.linux_sources + '/.config', conf.dot_config_back_file)
+
with open(conf.linux_sources + '/.config', 'r') as f:
with open(conf.required_file, 'w') as freq:
- with open(conf.dot_config_file, 'w') as fconf:
+ with open(conf.dot_config_fragment_file, 'w') as fconf:
for line in f:
if (line[0] == '#') or (not '=' in line):
continue
diff --git a/scripts/solution.py b/scripts/solution.py
index fd6aa23..99e8418 100644
--- a/scripts/solution.py
+++ b/scripts/solution.py
@@ -90,7 +90,7 @@ def apply():
# Write solution to .config file in linux source folder
with open(conf.linux_sources + '/.config', 'w') as f:
- with open(conf.dot_config_file, 'r') as fconf:
+ with open(conf.dot_config_fragment_file, 'r') as fconf:
for line in fconf:
f.write(line)