diff options
author | Karel Kočí <cynerd@email.cz> | 2015-05-15 01:38:34 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-05-15 01:38:34 +0200 |
commit | f9bd4784d55c6e2afe4c102a1212a7661ac0ef80 (patch) | |
tree | fa2140a1147e6805f502f41ffcf06a860f807feb /scripts/solution.py | |
parent | 2e9ef6384bf9a9b599a5f7438d8772fcbccb760f (diff) | |
download | linux-conf-perf-f9bd4784d55c6e2afe4c102a1212a7661ac0ef80.tar.gz linux-conf-perf-f9bd4784d55c6e2afe4c102a1212a7661ac0ef80.tar.bz2 linux-conf-perf-f9bd4784d55c6e2afe4c102a1212a7661ac0ef80.zip |
Rewrite write_config solution check and fix apply
solution.apply failed in case of last solution.
Diffstat (limited to 'scripts/solution.py')
-rw-r--r-- | scripts/solution.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/solution.py b/scripts/solution.py index 37db112..2eed129 100644 --- a/scripts/solution.py +++ b/scripts/solution.py @@ -107,15 +107,24 @@ def apply(): solved.add(ln.strip()) # Load one solution if it is not in solved + hash = '' with open(sf(conf.config_map_file)) as f: while True: w = f.readline().split(sep=':') + if not w[0]: + break if not w[0] in solved: solution = utils.config_strtoint(w[1]) - break; + hash = w[0] + break if not solution: raise exceptions.NoApplicableSolution() + # Write hash to config_solved + with open(sf(conf.config_solved_file), 'a') as f: + f.write(hash) + f.write('\n') + # Load variable count with open(sf(conf.symbol_map_file)) as f: for var_num, l in enumerate(f): |