Bug 780561 - Fix the buildconfig python module handling of environment variables. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 23 Jan 2013 11:23:15 +0100
changeset 129350 bd4704b3f8a2fd6d29019c563f09bddb11fc3d47
parent 129349 bff0f21a6d7be825abc2bd4297434e417259b5a4
child 129351 ec95c1d93af00cc8baf8ed5c0448cd478f2db539
push idunknown
push userunknown
push dateunknown
reviewersted
bugs780561
milestone21.0a1
Bug 780561 - Fix the buildconfig python module handling of environment variables. r=ted
build/buildconfig.py
--- a/build/buildconfig.py
+++ b/build/buildconfig.py
@@ -11,17 +11,20 @@ while not os.path.exists(os.path.join(pa
     parent = os.path.normpath(os.path.join(path, os.pardir))
     if parent == path:
         raise Exception("Can't find config.status")
     path = parent
 
 path = os.path.join(path, 'config.status')
 config = imp.load_module('_buildconfig', open(path), path, ('', 'r', imp.PY_SOURCE))
 
-for var in os.environ:
-    if var in config.substs:
-        config.substs[var] = os.environ[var]
-
+# Copy values from the config.status namespace into this module namespace.
+# This effectively imports topsrcdir, topobjdir, defines, substs, files,
+# headers and non_global_defines
 for var in config.__all__:
     value = getattr(config, var)
     if isinstance(value, list) and value and isinstance(value[0], tuple):
         value = dict(value)
     setattr(sys.modules[__name__], var, value)
+
+for var in os.environ:
+    if var != 'SHELL' and var in substs:
+        substs[var] = os.environ[var]