Bug 794966 - Treat environment variables as = assignments instead of := in pymake. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 02 Oct 2012 14:18:00 +0200
changeset 109008 5a3024f9a7447752e3d248b2e032e6ad8b39a604
parent 109007 dc70ce87180c1c8e2c68ece7c5927205eb6ff7e9
child 109009 ef321673c843dd0e570770d4e3134376ad871591
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersted
bugs794966
milestone18.0a1
Bug 794966 - Treat environment variables as = assignments instead of := in pymake. r=ted
build/pymake/pymake/data.py
build/pymake/tests/env-var-append.mk
build/pymake/tests/env-var-append2.mk
--- a/build/pymake/pymake/data.py
+++ b/build/pymake/pymake/data.py
@@ -442,17 +442,17 @@ class Variables(object):
     SOURCE_IMPLICIT = 5
 
     def __init__(self, parent=None):
         self._map = {} # vname -> flavor, source, valuestr, valueexp
         self.parent = parent
 
     def readfromenvironment(self, env):
         for k, v in env.iteritems():
-            self.set(k, self.FLAVOR_SIMPLE, self.SOURCE_ENVIRONMENT, v)
+            self.set(k, self.FLAVOR_RECURSIVE, self.SOURCE_ENVIRONMENT, v)
 
     def get(self, name, expand=True):
         """
         Get the value of a named variable. Returns a tuple (flavor, source, value)
 
         If the variable is not present, returns (None, None, None)
 
         @param expand If true, the value will be returned as an expansion. If false,
new file mode 100644
--- /dev/null
+++ b/build/pymake/tests/env-var-append.mk
@@ -0,0 +1,7 @@
+#T environment: {'FOO': 'TEST'}
+
+FOO += $(BAR)
+BAR := PASS
+
+all:
+	@echo $(subst $(NULL) ,-,$(FOO))
new file mode 100644
--- /dev/null
+++ b/build/pymake/tests/env-var-append2.mk
@@ -0,0 +1,8 @@
+#T environment: {'FOO': '$(BAZ)'}
+
+FOO += $(BAR)
+BAR := PASS
+BAZ := TEST
+
+all:
+	@echo $(subst $(NULL) ,-,$(FOO))