From 9ca8696a489b5c16a2239213919c9e8b7f8c55d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 19 Aug 2015 21:44:16 +0200 Subject: Fix wrong input type to compare_text in register_conf --- scripts/configurations.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'scripts/configurations.py') diff --git a/scripts/configurations.py b/scripts/configurations.py index 428e214..63c4016 100644 --- a/scripts/configurations.py +++ b/scripts/configurations.py @@ -84,26 +84,29 @@ def __exec_sat__(file, args, conf_num): return con def __txt_config__(con): - txt = '' + config = [] for key, val in con.items(): - txt += 'CONFIG_' + key + '=' + txt = 'CONFIG_' + key + '=' if val: txt += 'y' else: txt += 'n' - txt += '\n' - return txt + config.append(txt) + return config def __write_temp_config_file__(con): wfile = tempfile.NamedTemporaryFile(delete=False) txt = __txt_config__(con) - wfile.write(bytes(txt, sys.getdefaultencoding())) + for ln in txt: + wfile.write(bytes(ln + '\n', sys.getdefaultencoding())) wfile.close() return wfile.name def __load_config_text__(txt): rtn = dict() for ln in txt: + if not ln: + continue if ln[0] == '#' or not '=' in ln: continue indx = ln.index('=') @@ -160,7 +163,7 @@ def __register_conf__(con, conf_num, generator): cconf = dtb.get_configration(hsh) for cc in cconf: print('hash: ' + hsh) - if compare_text(cc, txtconfig): + if compare_text(cc.config, txtconfig): print("I: Generated existing configuration.") return False else: -- cgit v1.2.3