Bug 1256574 - Make the part writing and executing config.status importable for c-c. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 15 Mar 2016 16:41:53 +0900
changeset 288840 4b048c4d03d89638616e3b733f6b2ae59023d5e7
parent 288839 2eb222bbb28345c32180041dba9ca24e86db8da6
child 288841 a6fc6ab667a6a44a335210dd6f3402eea67292e9
push id18197
push usercbook@mozilla.com
push dateWed, 16 Mar 2016 10:26:37 +0000
treeherderfx-team@4b3a31a77586 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1256574
milestone48.0a1
Bug 1256574 - Make the part writing and executing config.status importable for c-c. r=gps
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))