Mesa (master): scons: Parse = operator in source lists too.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sun Apr 29 20:42:57 UTC 2012


Module: Mesa
Branch: master
Commit: 4c15a77f27204620ed35d97d75e521ca982e1cc5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c15a77f27204620ed35d97d75e521ca982e1cc5

Author: José Fonseca <jose.r.fonseca at gmail.com>
Date:   Sun Apr 29 21:44:05 2012 +0100

scons: Parse = operator in source lists too.

Should fix the scons build.

---

 scons/source_list.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/scons/source_list.py b/scons/source_list.py
index fbd3ef7..1d5166b 100644
--- a/scons/source_list.py
+++ b/scons/source_list.py
@@ -3,7 +3,7 @@
 The syntax of a source list file is a very small subset of GNU Make.  These
 features are supported
 
- operators: +=, :=
+ operators: =, +=, :=
  line continuation
  non-nested variable expansion
  comment
@@ -62,17 +62,18 @@ class SourceListParser(object):
         if op_pos < 0:
             self._error('not a variable definition')
 
-        if op_pos > 0 and line[op_pos - 1] in [':', '+']:
-            op_pos -= 1
+        if op_pos > 0:
+            if line[op_pos - 1] in [':', '+']:
+                op_pos -= 1
         else:
-            self._error('only := and += are supported')
+            self._error('only =, :=, and += are supported')
 
         # set op, sym, and val
         op = line[op_pos:op_end]
         sym = line[:op_pos].strip()
         val = self._expand_value(line[op_end:].lstrip())
 
-        if op == ':=':
+        if op in ('=', ':='):
             self.symbol_table[sym] = val
         elif op == '+=':
             self.symbol_table[sym] += ' ' + val




More information about the mesa-commit mailing list