Bug 914935 - Fix pymake handling of colon in includedep files. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 12 Sep 2013 08:14:44 +0900
changeset 146623 895784bef7fd3464860f5d8a7102d8ae89da604a
parent 146622 3a9f27b2a213ad7a5424f3c19b1db3924d87c365
child 146624 237c3227948158d41d6c6dd3ea2bf915681e352f
push id33653
push usermh@glandium.org
push dateWed, 11 Sep 2013 23:15:55 +0000
treeherdermozilla-inbound@237c32279481 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs914935
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 914935 - Fix pymake handling of colon in includedep files. r=gps
build/pymake/pymake/parser.py
--- a/build/pymake/pymake/parser.py
+++ b/build/pymake/pymake/parser.py
@@ -367,16 +367,19 @@ def parsefile(pathname):
     """
     Parse a filename into a parserdata.StatementList. A cache is used to avoid re-parsing
     makefiles that have already been parsed and have not changed.
     """
 
     pathname = os.path.realpath(pathname)
     return _parsecache.get(pathname)
 
+# colon followed by anything except a slash (Windows path detection)
+_depfilesplitter = re.compile(r':(?![\\/])')
+
 def parsedepfile(pathname):
     """
     Parse a filename listing only depencencies into a parserdata.StatementList.
     """
     def continuation_iter(lines):
         current_line = []
         for line in lines:
             line = line.rstrip()
@@ -389,17 +392,17 @@ def parsedepfile(pathname):
             yield ''.join(current_line)
             current_line = []
         if current_line:
             yield ''.join(current_line)
 
     pathname = os.path.realpath(pathname)
     stmts = parserdata.StatementList()
     for line in continuation_iter(open(pathname).readlines()):
-        target, deps = line.split(":", 1)
+        target, deps = _depfilesplitter.split(line, 1)
         stmts.append(parserdata.Rule(data.StringExpansion(target, None),
                                      data.StringExpansion(deps, None), False))
     return stmts
 
 def parsestring(s, filename):
     """
     Parse a string containing makefile data into a parserdata.StatementList.
     """