diff options
author | Karel Kočí <cynerd@email.cz> | 2015-05-14 10:50:34 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-05-14 10:50:34 +0200 |
commit | 71ffeac967944bfd4f61d1f5724c8aed9d6d35a3 (patch) | |
tree | 6e57b85646280a6cebe016298bf97a618e867881 /scripts | |
parent | 47e9eade57344dbb249b7cee3fa7afeaeb7f322f (diff) | |
download | linux-conf-perf-71ffeac967944bfd4f61d1f5724c8aed9d6d35a3.tar.gz linux-conf-perf-71ffeac967944bfd4f61d1f5724c8aed9d6d35a3.tar.bz2 linux-conf-perf-71ffeac967944bfd4f61d1f5724c8aed9d6d35a3.zip |
Fix problems with configurations genration
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/initialize.py | 8 | ||||
-rw-r--r-- | scripts/solution.py | 31 |
2 files changed, 21 insertions, 18 deletions
diff --git a/scripts/initialize.py b/scripts/initialize.py index fa2492d..35510d2 100755 --- a/scripts/initialize.py +++ b/scripts/initialize.py @@ -11,13 +11,18 @@ import exceptions import loop import solution +import exceptions + def all(): base() gen_nbscript() parse_kconfig() gen_requred() if conf.gen_all_solution_oninit: - solution.generate() + try: + solution.generate() + except exceptions.NoSolution: + pass def base(): print('Initialize base...') @@ -75,7 +80,6 @@ def gen_requred(): freq.write(str(srmap[line[7:indx]]) + "\n") elif (line[indx + 1] == 'n' or line[indx + 1] == 'm'): freq.write("-" + str(srmap[line[7:indx]]) + "\n") - freq.write("-" + str(srmap["MODULES"]) + "\n"); # force modules no def gen_nbscript(): diff --git a/scripts/solution.py b/scripts/solution.py index 1ee1664..61cf65c 100644 --- a/scripts/solution.py +++ b/scripts/solution.py @@ -70,22 +70,21 @@ def generate(): if conf.picosat_output: print(line, end="") if line[0] == 's': - if line.rstrip() == 's SATISFIABLE': - try: - solut.remove(0) - with open(sf(conf.config_map_file), 'a') as fm: - fm.write(str(utils.hash_config(solut)) + ':') - for sl in solut: - fm.write(str(sl) + ' ') - fm.write('\n') - with open(sf(conf.solved_file), 'a') as fs: - for sl in solut: - fs.write(str(-1 * sl) + ' ') - fs.write('\n') - except ValueError: - pass - solut = [] - else: + try: + solut.remove(0) + with open(sf(conf.config_map_file), 'a') as fm: + fm.write(str(utils.hash_config(solut)) + ':') + for sl in solut: + fm.write(str(sl) + ' ') + fm.write('\n') + with open(sf(conf.solved_file), 'a') as fs: + for sl in solut: + fs.write(str(-1 * sl) + ' ') + fs.write('\n') + except ValueError: + pass + solut = [] + if not line.rstrip() == 's SATISFIABLE': os.remove(w_file.name) raise exceptions.NoSolution() elif line[0] == 'v': |