aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-05-01 20:56:11 +0200
committerKarel Kočí <cynerd@email.cz>2015-05-01 20:56:11 +0200
commite28527d51902219425d6590fff2664ffdba4526f (patch)
treeef3c7b4318df8a15c435a1905f6eefb02d1458b1 /scripts
parent3fb6326fc36c69aa0b66de4823b116d7c0a9486c (diff)
downloadlinux-conf-perf-e28527d51902219425d6590fff2664ffdba4526f.tar.gz
linux-conf-perf-e28527d51902219425d6590fff2664ffdba4526f.tar.bz2
linux-conf-perf-e28527d51902219425d6590fff2664ffdba4526f.zip
Fit solution.apply to new changes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/solution.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/solution.py b/scripts/solution.py
index 0e4efcd..21f6d88 100644
--- a/scripts/solution.py
+++ b/scripts/solution.py
@@ -41,13 +41,11 @@ def generate():
if ln not in lines:
lines.add(ln)
- with open(sf(conf.symbol_map_file)) as f:
- for var_num, l in enumerate(f):
- pass
- var_num += 1
+ with open(sf(conf.variable_count_file)) as f:
+ var_num = f.readline()
lines_count = len(lines)
- first_line = "p cnf " + str(var_num) + " " + str(lines_count)
+ first_line = "p cnf " + var_num + " " + str(lines_count)
w_file.write(bytes(first_line + '\n', 'UTF-8'))
for ln in lines:
w_file.write(bytes(ln + ' 0\n', 'UTF-8'))
@@ -100,6 +98,10 @@ def apply():
f.write( ntx + txt + " ")
f.write("\n")
+ with open(sf(conf.symbol_map_file)) as f:
+ for var_num, l in enumerate(f):
+ pass
+ var_num += 1
# Write solution to .config file in linux source folder
with open(sf(conf.linux_dot_config), 'w') as f:
for txt in solut:
@@ -108,6 +110,8 @@ def apply():
txt = txt[1:]
else:
nt = False
+ if int(txt) >= var_num:
+ break;
if 'NONAMEGEN' in utils.smap[txt]: # ignore generated names
continue