diff options
author | Jack Lloyd <[email protected]> | 2019-04-18 09:46:38 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-04-18 09:48:45 -0400 |
commit | 1b78407b425807f3fa168ed0c034e04e8c005477 (patch) | |
tree | 9857db70ba08cfd49061283a7a105f3490deb240 /configure.py | |
parent | 2ea8ccf7e65789931d32f857d112c8cf4277061a (diff) |
Check parsing of maps
Previous commit changed the parsing of <libs> and <frameworks> from
being lists to maps. But this broke macOS certstore which defined
frameworks on individual lines, causing only one to be used.
Add a test that maps don't have duplicated entries, and fix the info.txt
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/configure.py b/configure.py index 819390cc8..b55c95d09 100755 --- a/configure.py +++ b/configure.py @@ -674,19 +674,19 @@ class LexerError(InternalError): def __str__(self): return '%s at %s:%d' % (self.msg, self.lexfile, self.line) - -def parse_lex_dict(as_list): +def parse_lex_dict(as_list, map_name, infofile): if len(as_list) % 3 != 0: raise InternalError("Lex dictionary has invalid format (input not divisible by 3): %s" % as_list) result = {} for key, sep, value in [as_list[3*i:3*i+3] for i in range(0, len(as_list)//3)]: if sep != '->': - raise InternalError("Lex dictionary has invalid format") + raise InternalError("Map %s in %s has invalid format" % (map_name, infofile)) + if key in result: + raise InternalError("Duplicate map entry %s in map %s file %s" % (key, map_name, infofile)) result[key] = value return result - def lex_me_harder(infofile, allowed_groups, allowed_maps, name_val_pairs): """ Generic lexer function for info.txt and src/build-data files @@ -745,7 +745,7 @@ def lex_me_harder(infofile, allowed_groups, allowed_maps, name_val_pairs): raise LexerError('Bad token "%s"' % (token), infofile, lexer.lineno) for group in allowed_maps: - out.__dict__[group] = parse_lex_dict(out.__dict__[group]) + out.__dict__[group] = parse_lex_dict(out.__dict__[group], group, infofile) return out |