Bug 1256574 - Make the part writing and executing config.status importable for c-c draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 15 Mar 2016 16:41:53 +0900
changeset 340440 32d1b9f378be035704bf1c7c2b6ed1b39f05c081
parent 340439 7fd99a35ac93c34fd9f2a03330942f9763f42c8a
child 340449 3472fb32d5d8b3d830ea86474f258cbbeaba873b
push id12961
push userbmo:mh+mozilla@glandium.org
push dateTue, 15 Mar 2016 07:44:03 +0000
bugs1256574
milestone48.0a1
Bug 1256574 - Make the part writing and executing config.status importable for c-c
configure.py
--- a/configure.py
+++ b/configure.py
@@ -19,16 +19,20 @@ from mozbuild.configure import Configure
 def main(argv):
     config = {}
     sandbox = ConfigureSandbox(config, os.environ, argv)
     sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
 
     if sandbox._help:
         return 0
 
+    return config_status(config)
+
+
+def config_status(config):
     # Sanitize config data to feed config.status
     sanitized_config = {}
     sanitized_config['substs'] = {
         k: v for k, v in config.iteritems()
         if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
     }
     sanitized_config['defines'] = config['DEFINES']
     sanitized_config['non_global_defines'] = config['non_global_defines']
@@ -64,10 +68,11 @@ if __name__ == '__main__':
     if not config.get('BUILDING_JS') or config.get('JS_STANDALONE'):
         if not config.get('JS_STANDALONE'):
             os.environ['WRITE_MOZINFO'] = '1'
         # Until we have access to the virtualenv from this script, execute
         # config.status externally, with the virtualenv python.
         return subprocess.call([config['PYTHON'], 'config.status'])
     return 0
 
+
 if __name__ == '__main__':
     sys.exit(main(sys.argv))