Skip to content
Snippets Groups Projects
Commit c4eadb84 authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1258618 - Serialize substs/configs and defines bools as '1' or '' in...

Bug 1258618 - Serialize substs/configs and defines bools as '1' or '' in config.status. r=nalexander

This allows to use True and False as values given to
set_config/set_define in moz.configure files, while postponing having to
deal with the long tail of things depending on the values from substs
and defines.

Ideally, everything would handle the bools just fine, but there are too
many things involved to deal with this right now: scripts using
buildconfig.{substs,defines}, scripts using ConfigEnvironment (e.g.
process_define_files.py), ConfigEnvironment itself, etc.
parent c5fa9907
No related branches found
No related tags found
No related merge requests found
......@@ -29,12 +29,24 @@ def main(argv):
def config_status(config):
# Sanitize config data to feed config.status
# Ideally, all the backend and frontend code would handle the booleans, but
# there are so many things involved, that it's easier to keep config.status
# untouched for now.
def sanitized_bools(v):
if v is True:
return '1'
if v is False:
return ''
return v
sanitized_config = {}
sanitized_config['substs'] = {
k: v for k, v in config.iteritems()
k: sanitized_bools(v) for k, v in config.iteritems()
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
}
sanitized_config['defines'] = config['DEFINES']
sanitized_config['defines'] = {
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
}
sanitized_config['non_global_defines'] = config['non_global_defines']
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
sanitized_config['topobjdir'] = config['TOPOBJDIR']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment