mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Update pymake snapshot to pull Bug 755828 and remove incorrectly added MPL 2 headers.
This commit is contained in:
parent
b1b7277c0a
commit
2e01633bf7
@ -1,8 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
"""
|
||||
make.py
|
||||
|
@ -1,8 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
|
||||
import sys
|
||||
import pymake.parser
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# Basic commands implemented in Python
|
||||
import errno, sys, os, shutil, time
|
||||
from getopt import getopt, GetoptError
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
A representation of makefile data structures.
|
||||
"""
|
||||
@ -105,7 +101,7 @@ class StringExpansion(object):
|
||||
assert i == 0
|
||||
return self.s, False
|
||||
|
||||
def __str__(self):
|
||||
def __repr__(self):
|
||||
return "Exp<%s>(%r)" % (self.loc, self.s)
|
||||
|
||||
class Expansion(list):
|
||||
@ -113,14 +109,13 @@ class Expansion(list):
|
||||
A representation of expanded data, such as that for a recursively-expanded variable, a command, etc.
|
||||
"""
|
||||
|
||||
__slots__ = ('loc', 'hasfunc')
|
||||
__slots__ = ('loc',)
|
||||
simple = False
|
||||
|
||||
def __init__(self, loc=None):
|
||||
# A list of (element, isfunc) tuples
|
||||
# element is either a string or a function
|
||||
self.loc = loc
|
||||
self.hasfunc = False
|
||||
|
||||
@staticmethod
|
||||
def fromstring(s, path):
|
||||
@ -141,7 +136,6 @@ class Expansion(list):
|
||||
def appendfunc(self, func):
|
||||
assert isinstance(func, functions.Function)
|
||||
self.append((func, True))
|
||||
self.hasfunc = True
|
||||
|
||||
def concat(self, o):
|
||||
"""Concatenate the other expansion on to this one."""
|
||||
@ -149,7 +143,6 @@ class Expansion(list):
|
||||
self.appendstr(o.s)
|
||||
else:
|
||||
self.extend(o)
|
||||
self.hasfunc = self.hasfunc or o.hasfunc
|
||||
|
||||
def isempty(self):
|
||||
return (not len(self)) or self[0] == ('', False)
|
||||
@ -183,10 +176,33 @@ class Expansion(list):
|
||||
del self[-1]
|
||||
|
||||
def finish(self):
|
||||
if self.hasfunc:
|
||||
return self
|
||||
# Merge any adjacent literal strings:
|
||||
strings = []
|
||||
elements = []
|
||||
for (e, isfunc) in self:
|
||||
if isfunc:
|
||||
if strings:
|
||||
s = ''.join(strings)
|
||||
if s:
|
||||
elements.append((s, False))
|
||||
strings = []
|
||||
elements.append((e, True))
|
||||
else:
|
||||
strings.append(e)
|
||||
|
||||
return StringExpansion(''.join([i for i, isfunc in self]), self.loc)
|
||||
if not elements:
|
||||
# This can only happen if there were no function elements.
|
||||
return StringExpansion(''.join(strings), self.loc)
|
||||
|
||||
if strings:
|
||||
s = ''.join(strings)
|
||||
if s:
|
||||
elements.append((s, False))
|
||||
|
||||
if len(elements) < len(self):
|
||||
self[:] = elements
|
||||
|
||||
return self
|
||||
|
||||
def resolve(self, makefile, variables, fd, setting=[]):
|
||||
"""
|
||||
@ -698,7 +714,10 @@ class RemakeRuleContext(object):
|
||||
else:
|
||||
for d, weak in self.deps:
|
||||
if mtimeislater(d.mtime, self.target.mtime):
|
||||
self.target.beingremade()
|
||||
if d.mtime is None:
|
||||
self.target.beingremade()
|
||||
else:
|
||||
_log.info("%sNot remaking %s ubecause it would have no effect, even though %s is newer.", indent, self.target.target, d.target)
|
||||
break
|
||||
cb(error=False)
|
||||
return
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
Makefile functions.
|
||||
"""
|
||||
@ -51,6 +47,12 @@ class Function(object):
|
||||
def __len__(self):
|
||||
return len(self._arguments)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s<%s>(%r)" % (
|
||||
self.__class__.__name__, self.loc,
|
||||
','.join([repr(a) for a in self._arguments]),
|
||||
)
|
||||
|
||||
class VariableRef(Function):
|
||||
__slots__ = ('vname', 'loc')
|
||||
|
||||
@ -74,6 +76,9 @@ class VariableRef(Function):
|
||||
|
||||
value.resolve(makefile, variables, fd, setting + [vname])
|
||||
|
||||
def __repr__(self):
|
||||
return "VariableRef<%s>(%r)" % (self.loc, self.vname)
|
||||
|
||||
class SubstitutionRef(Function):
|
||||
"""$(VARNAME:.c=.o) and $(VARNAME:%.c=%.o)"""
|
||||
|
||||
@ -109,6 +114,10 @@ class SubstitutionRef(Function):
|
||||
fd.write(' '.join([f.subst(substto, word, False)
|
||||
for word in value.resolvesplit(makefile, variables, setting + [vname])]))
|
||||
|
||||
def __repr__(self):
|
||||
return "SubstitutionRef<%s>(%r:%r=%r)" % (
|
||||
self.loc, self.vname, self.substfrom, selfsubstto,)
|
||||
|
||||
class SubstFunction(Function):
|
||||
name = 'subst'
|
||||
minargs = 3
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
Filename globbing like the python glob module with minor differences:
|
||||
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
Implicit variables; perhaps in the future this will also include some implicit
|
||||
rules, at least match-anything cancellation rules.
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
Module for parsing Makefile syntax.
|
||||
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import logging, re, os
|
||||
import data, parser, functions, util
|
||||
from cStringIO import StringIO
|
||||
@ -470,6 +466,9 @@ class UnexportDirective(Statement):
|
||||
for v in vlist:
|
||||
makefile.exportedvars[v] = False
|
||||
|
||||
def dump(self, fd, indent):
|
||||
print >>fd, "%sUnexport %s" % (indent, self.exp)
|
||||
|
||||
class EmptyDirective(Statement):
|
||||
__slots__ = ('exp',)
|
||||
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"""
|
||||
Skipping shell invocations is good, when possible. This wrapper around subprocess does dirty work of
|
||||
parsing command lines into argv and making sure that no shell magic is being used.
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import os
|
||||
|
||||
class MakeError(Exception):
|
||||
|
@ -1,7 +1,3 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from ctypes import windll, POINTER, byref, WinError
|
||||
from ctypes.wintypes import WINFUNCTYPE, HANDLE, DWORD, BOOL
|
||||
|
||||
|
@ -9,5 +9,5 @@ def writeenvtofile(args):
|
||||
f.write(os.environ[args[1]])
|
||||
|
||||
def asplode(args):
|
||||
sys.exit(args[0])
|
||||
sys.exit(0)
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user