Bug 1293868 - Write mozinfo.json deterministically; r?glandium
And with indentation so it is easier for humans to read.
MozReview-Commit-ID: Kkd6vmfLNUf
--- a/python/mozbuild/mozbuild/mozinfo.py
+++ b/python/mozbuild/mozbuild/mozinfo.py
@@ -150,12 +150,11 @@ def write_mozinfo(file, config, env=os.e
"""Write JSON data about the configuration specified in config and an
environment variable dict to |file|, which may be a filename or file-like
object.
See build_dict for information about what environment variables are used,
and what keys are produced.
"""
build_conf = build_dict(config, env)
if isinstance(file, basestring):
- with open(file, "w") as f:
- json.dump(build_conf, f)
- else:
- json.dump(build_conf, file)
+ file = open(file, 'wb')
+
+ json.dump(build_conf, file, sort_keys=True, indent=4)