aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-08-13 11:42:51 +0200
committerKarel Kočí <cynerd@email.cz>2015-08-13 11:42:51 +0200
commit5bf8e17c83d4b5500fd81edaee5c495161e1f0ba (patch)
tree6ce5830ef2670f14c3516fb44b471f1ec03296b3 /scripts
parent88bce0d3359f570388c21e04c0556e6736afc28b (diff)
downloadlinux-conf-perf-5bf8e17c83d4b5500fd81edaee5c495161e1f0ba.tar.gz
linux-conf-perf-5bf8e17c83d4b5500fd81edaee5c495161e1f0ba.tar.bz2
linux-conf-perf-5bf8e17c83d4b5500fd81edaee5c495161e1f0ba.zip
Fix generate single configuration
This fixes and ensures that every call generates configuration. Unless False is returned.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/configurations.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/configurations.py b/scripts/configurations.py
index 0b73a53..a9ede05 100644
--- a/scripts/configurations.py
+++ b/scripts/configurations.py
@@ -167,21 +167,22 @@ def __generate_single__(var_num, conf_num):
else:
with open(sf(conf.single_generated_file), 'r') as f:
for ln in f:
- measure_list.append(int(ln))
- if measure_list:
+ measure_list.add(int(ln))
+ if not measure_list:
return False
tfile = __buildtempcnf__(var_num, (sf(conf.rules_file),
sf(conf.fixed_file)), (str(measure_list.pop())))
+ with open(sf(conf.single_generated_file), 'w') as fo:
+ fo.writelines(measure_list)
try:
confs = __exec_sat__(tfile, ['-i', '0'])
for con in confs:
__register_conf__(con, conf_num, 'single-sat')
except exceptions.NoSolution:
- pass
+ os.remove(tfile)
+ return __generate_single__(var_num, conf_num)
finally:
os.remove(tfile)
- with open(sf(conf.single_generated_file), 'w') as fo:
- fo.writelines(measure_list)
return True
def __generate_random__(var_num, conf_num):