mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- fix restore button on MacOS 10.6 fullscreen (08151078bd)
- Bug 1216580 - Make background-position:fixed clip stealing work with display items that create their own layer. r=mattwoodrow (7760c8ddd8)
- Bug 1222661 - Replace ToUntyped(obj) calls with obj.ToUnknown*(). r=nical (76e36824f0)
- Bug 1223310 (part 1) - Pass a LayoutDeviceIntPoint instead of an nsIntPoint to InitEvent(). r=kats. (ea95207afe)
- Bug 1223310 (part 2) - Use LayoutDeviceIntRect for bounds-related functions in nsIWidget. r=kats. (4993cccff8)
- Bug 1218552 - Fix GTK drag-and-drop coordinate scaling on HiDPI displays (r=karlt) (d03cf04136)
- fix preprocessing (2f4c1a1c94)
- Bug 1205923: Make VectorImage::GetWidth/GetHeight set outparam to 0 (not -1) on failure, to accomodate callers that don't check error codes. r=seth (487de31340)
- Bug 1212954 - Make BaseSize::IsEmpty return true for negative sizes to avoid NS_ERROR in VectorImage::GetFrameAtSize when root svg doesn't have intrinsic width or height. r=roc (402b154f56)
- fix ordering (ac8483c966)
- Bug 1216056 - Always sent OpRemoveTextureAsync as pending async Messages r=nica (66c9ee8708)
- Bug 121976 - Add a destruction handshake to PCompositable so as to avoid races between messages and the protocol. r=sotaro (636a669e44)
- Bug 1209724 - Cancel ImageBridge proxy functions if they are called too late. r=sotao (5bf81453ef)
- Bug 1221371 - Switch chromium IPC code to use mozilla::Tuple (r=jld,cpearce,kats) (eebcd419e9)
- Bug 1221371 - Remove unused Chromium callback code (r=jld) (3f2e882485)
- Bug 1221368 - Change MakeTuple to decay the types of its arguments (r=froydnj) (bed635f565)
- Bug 1181303. Set composition time earlier so that computing invalid regions works properly. r=mattwoodrow (7a3e41cd96)
- Bug 1150552 - Fix partial present bug with FPS counter. r=mattwoodrow (6e6ae92909)
- Bug 1216287 - Properly invalidate the debug overlay. r=mattwoodrow (60d4f3451a)
- Compute the compositor's damage region before composites, rather than layers updates. (bug 1217560, r=mattwoodrow) (6efcac085b)
- Bug 1216248 - Recomposite when the window overlay changes. r=mattwoodrow (8a8c5ccd07)
- Bug 1224021 - Support fractional async scroll offsets in the reftest harness. r=tn (353f75d3aa)
- Bug 1121072 - Always notify when layers cleared (r=dvander) (aa6ffc67e2)
- Bug 1224403 (part 1) - Make Configuration::mBounds a LayoutDeviceIntRect. r=kats. (7617b9da7e)
- Bug 1224403 (part 2) - Split GetClientOffset() into typed and untyped versions. r=kats. (06916479b1)
- Bug 1224403 (part 3) - Make mNonClientOffset a LayoutDeviceIntMargin. r=kats. (76efba1fb6)
- Bug 1224403 (part 4) - Make {Get,Set}NonClientMargins() return/take aLayoutDeviceIntMargin. r=kats. (99cfc2fdbc)
- Bug 1224403 (part 5) - Make OnDefaultButtonLoaded() return/take a LayoutDeviceIntMargin. r=kats (c402452f97)
- Bug 1224403 (part 6) - Remove one WidgetToScreenOffsetUntyped() call. r=kats. (8e4485a404)
- Bug 1224403 (part 7) - Use LayoutDeviceIntMargin more in IMMHandler. r=kats. (6b5e9124fc)
- Bug 1224403 (part 8) - Use LayoutDeviceIntMargin more in HyperTextAccessible. r=kats. (5bc1a04cc7)
- Bug 1224403 (part 9) - Remove GetRestoredBoundsUntyped(). r=kats. (20e2b28335)
- Bug 1224403 (part 10) - Make nsScreenGonk::GetNaturalBoundsUntyped() typed. r=kats. (9d19986f22)
- Bug 1224403 (part 11) - Remove a GetBoundsUntyped() call. r=kats. (58ce962157)
- Bug 1214267 - Followup to fix missing propagation of 'fixedPositionSides' to the compositor, and add it to the layers dump. r=mattwoodrow (7dc122eb62)
- Use compositor clip rects, not client clip rects, when computing the compositor's backbuffer damage region. (bug 1189159, r=mattwoodrow) (b70d71b1b7)
- Bug 1210784 - Layer tree invalidation with Preserves3D. r=roc (8a7bfa1a22)
- Bug 1166165 - Check if the timestamp is null to prevent assertion. r=nical (189a8d42d0)
- Bug 1137004 - Changed the location of the counter so when it is used in a maximized window it is no longer cut off, and added a little left padding. r=mattwoodrow (140d294445)
- Bug 1222661 - Replace FromUntyped(obj) calls with FromUnknown*(obj). r=nical (b399ccef2e)
- Bug 1216506. Properly initialize min inset box shadow color to black. r=mstange (335259200c)
- Bug 1223690 - Remove implicit Rect conversions. r=jrmuizel. (5aef25158f)
- Bug 1056356 - Allow calling NewRunnableMethod() with a const pointer to the callee object. r=froydnj (145279b91c)
- Bug 1209649. Part 2: Reftest to test box shadows and border radii. r=mstange (9405ccfe23)
- Bug 1211363. Part 2: reftest with int border radius. r=mstange (9edb37635e)
- Bug 1216200. Inset box shadow reftest with negative spread value. r=mstange (8350478107)
- Bug 1211264. Fallback to render dest rect with outer box shadows on non-int transforms. r=mstange (a244775d24)
- Bug 1216200. Correct for negative spread values with inset box shadows. r=mstange (4851e9c792)
- cleanup (1f78332ad8)
- Bug 1213970 - Enable APZ on iOS r=kats (1d170e32e3)
- Bug 1217939 - part 1 - remove nsContentUtils::GetViewportInfo; r=smaug (8c25236851)
- Bug 1217939 - part 2 - move nsContentUtils::GetSelectionBoundingRect to nsLayoutUtils; r=smaug (6beb37157c)
- Bug 1146713 - Don't export NO_PKG_FILES (fix ssltunnel in b2g); r=glandium (a21152c79c)
- Bug 1222323 - Avoid passing extra defines to the compiler from config.mk. r=gps (2d1076d513)
- Bug 1222321 - Avoid the duplication of OS_CPPFLAGS on the compiler command line. r=gps (cf762f1644)
- Bug 1210687 - Separate out jar.mn parsing in a separate class. r=gps (d54cc5576b)
- Bug 1219147 - Use addEntriesToListFile in mozbuild.jar.JarMaker.updateManifest. r=mshal (3cd74ff478)
- Bug 1208160 - Show information when Xcode requires accepting license agreement; r=gps (352bb43d73)
- Bug 1174524 - Make objdir path comparison case-insensitive on Windows. r=mshal (6f74f10845)
- Bug 1158898 - Cache config.guess output; r=mshal (a7b01184fa)
- Bug 1187245 - Make .mozconfig.mk environment variables available to mach valgrind-test. r=gps (2033642ceb)
This commit is contained in:
@@ -33,7 +33,7 @@ def addEntriesToListFile(listFile, entries):
|
||||
for e in entries:
|
||||
if e not in existing:
|
||||
existing.add(e)
|
||||
with open(listFile, 'w') as f:
|
||||
with open(listFile, 'wb') as f:
|
||||
f.write("\n".join(sorted(existing))+"\n")
|
||||
finally:
|
||||
lock = None
|
||||
|
||||
@@ -25,9 +25,13 @@ from .mozconfig import (
|
||||
MozconfigLoadException,
|
||||
MozconfigLoader,
|
||||
)
|
||||
from .util import memoized_property
|
||||
from .virtualenv import VirtualenvManager
|
||||
|
||||
|
||||
_config_guess_output = []
|
||||
|
||||
|
||||
def ancestors(path):
|
||||
"""Emit the parent directories of a path."""
|
||||
while path:
|
||||
@@ -40,8 +44,8 @@ def ancestors(path):
|
||||
def samepath(path1, path2):
|
||||
if hasattr(os.path, 'samefile'):
|
||||
return os.path.samefile(path1, path2)
|
||||
return os.path.normpath(os.path.realpath(path1)) == \
|
||||
os.path.normpath(os.path.realpath(path2))
|
||||
return os.path.normcase(os.path.realpath(path1)) == \
|
||||
os.path.normcase(os.path.realpath(path2))
|
||||
|
||||
class BadEnvironmentException(Exception):
|
||||
"""Base class for errors raised when the build environment is not sane."""
|
||||
@@ -287,6 +291,23 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
def statedir(self):
|
||||
return os.path.join(self.topobjdir, '.mozbuild')
|
||||
|
||||
@memoized_property
|
||||
def extra_environment_variables(self):
|
||||
'''Some extra environment variables are stored in .mozconfig.mk.
|
||||
This functions extracts and returns them.'''
|
||||
from pymake.process import ClineSplitter
|
||||
mozconfig_mk = os.path.join(self.topobjdir, '.mozconfig.mk')
|
||||
env = {}
|
||||
with open(mozconfig_mk) as fh:
|
||||
for line in fh:
|
||||
if line.startswith('export '):
|
||||
exports = ClineSplitter(line, self.topobjdir)[1:]
|
||||
for e in exports:
|
||||
if '=' in e:
|
||||
key, value = e.split('=')
|
||||
env[key] = value
|
||||
return env
|
||||
|
||||
def is_clobber_needed(self):
|
||||
if not os.path.exists(self.topobjdir):
|
||||
return False
|
||||
@@ -353,6 +374,11 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
if config_guess:
|
||||
return config_guess
|
||||
|
||||
# config.guess results should be constant for process lifetime. Cache
|
||||
# it.
|
||||
if _config_guess_output:
|
||||
return _config_guess_output[0]
|
||||
|
||||
p = os.path.join(topsrcdir, 'build', 'autoconf', 'config.guess')
|
||||
|
||||
# This is a little kludgy. We need access to the normalize_command
|
||||
@@ -362,7 +388,9 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
o = MozbuildObject(topsrcdir, None, None, None)
|
||||
args = o._normalize_command([p], True)
|
||||
|
||||
return subprocess.check_output(args, cwd=topsrcdir).strip()
|
||||
_config_guess_output.append(
|
||||
subprocess.check_output(args, cwd=topsrcdir).strip())
|
||||
return _config_guess_output[0]
|
||||
|
||||
def notify(self, msg):
|
||||
"""Show a desktop notification with the supplied message
|
||||
@@ -554,36 +582,45 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
def _make_path(self):
|
||||
baseconfig = os.path.join(self.topsrcdir, 'config', 'baseconfig.mk')
|
||||
|
||||
def is_xcode_lisense_error(output):
|
||||
return self._is_osx() and 'Agreeing to the Xcode' in output
|
||||
|
||||
def validate_make(make):
|
||||
if os.path.exists(baseconfig) and os.path.exists(make):
|
||||
cmd = [make, '-f', baseconfig]
|
||||
if self._is_windows():
|
||||
cmd.append('HOST_OS_ARCH=WINNT')
|
||||
try:
|
||||
subprocess.check_call(cmd, stdout=open(os.devnull, 'wb'),
|
||||
stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError as e:
|
||||
return False, is_xcode_lisense_error(e.output)
|
||||
return True, False
|
||||
return False, False
|
||||
|
||||
xcode_lisense_error = False
|
||||
possible_makes = ['gmake', 'make', 'mozmake', 'gnumake']
|
||||
|
||||
if 'MAKE' in os.environ:
|
||||
make = os.environ['MAKE']
|
||||
if os.path.isabs(make):
|
||||
if validate_make(make):
|
||||
return [make]
|
||||
else:
|
||||
possible_makes.insert(0, make)
|
||||
possible_makes.insert(0, make)
|
||||
|
||||
for test in possible_makes:
|
||||
try:
|
||||
make = which.which(test)
|
||||
except which.WhichError:
|
||||
continue
|
||||
if validate_make(make):
|
||||
if os.path.isabs(test):
|
||||
make = test
|
||||
else:
|
||||
try:
|
||||
make = which.which(test)
|
||||
except which.WhichError:
|
||||
continue
|
||||
result, xcode_lisense_error_tmp = validate_make(make)
|
||||
if result:
|
||||
return [make]
|
||||
if xcode_lisense_error_tmp:
|
||||
xcode_lisense_error = True
|
||||
|
||||
if xcode_lisense_error:
|
||||
raise Exception('Xcode requires accepting to the license agreement.\n'
|
||||
'Please run Xcode and accept the license agreement.')
|
||||
|
||||
if self._is_windows():
|
||||
raise Exception('Could not find a suitable make implementation.\n'
|
||||
@@ -600,6 +637,9 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
def _is_windows(self):
|
||||
return os.name in ('nt', 'ce')
|
||||
|
||||
def _is_osx(self):
|
||||
return 'darwin' in str(sys.platform).lower()
|
||||
|
||||
def _spawn(self, cls):
|
||||
"""Create a new MozbuildObject-derived class instance from ourselves.
|
||||
|
||||
|
||||
+133
-118
@@ -18,16 +18,12 @@ import logging
|
||||
from time import localtime
|
||||
from MozZipFile import ZipFile
|
||||
from cStringIO import StringIO
|
||||
|
||||
from mozbuild.util import (
|
||||
ensureParentDir,
|
||||
lock_file,
|
||||
PushbackIter,
|
||||
)
|
||||
from collections import defaultdict
|
||||
|
||||
from mozbuild.preprocessor import Preprocessor
|
||||
from mozbuild.action.buildlist import addEntriesToListFile
|
||||
from mozpack.files import FileFinder
|
||||
import mozpack.path as mozpath
|
||||
if sys.platform == 'win32':
|
||||
from ctypes import windll, WinError
|
||||
CreateHardLink = windll.kernel32.CreateHardLinkA
|
||||
@@ -67,13 +63,28 @@ def getModTime(aPath):
|
||||
return localtime(mtime)
|
||||
|
||||
|
||||
class JarMaker(object):
|
||||
'''JarMaker reads jar.mn files and process those into jar files or
|
||||
flat directories, along with chrome.manifest files.
|
||||
'''
|
||||
class JarManifestEntry(object):
|
||||
def __init__(self, output, source, is_locale=False, preprocess=False,
|
||||
overwrite=False):
|
||||
self.output = output
|
||||
self.source = source
|
||||
self.is_locale = is_locale
|
||||
self.preprocess = preprocess
|
||||
self.overwrite = overwrite
|
||||
|
||||
|
||||
class JarInfo(object):
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
self.relativesrcdir = None
|
||||
self.chrome_manifests = []
|
||||
self.entries = []
|
||||
|
||||
|
||||
class JarManifestParser(object):
|
||||
|
||||
ignore = re.compile('\s*(\#.*)?$')
|
||||
jarline = re.compile('(?:(?P<jarfile>[\w\d.\-\_\\\/]+).jar\:)|(?:\s*(\#.*)?)\s*$')
|
||||
jarline = re.compile('(?P<jarfile>[\w\d.\-\_\\\/{}]+).jar\:$')
|
||||
relsrcline = re.compile('relativesrcdir\s+(?P<relativesrcdir>.+?):')
|
||||
regline = re.compile('\%\s+(.*)$')
|
||||
entryre = '(?P<optPreprocess>\*)?(?P<optOverwrite>\+?)\s+'
|
||||
@@ -81,6 +92,85 @@ class JarMaker(object):
|
||||
+ '(?P<output>[\w\d.\-\_\\\/\+\@]+)\s*(\((?P<locale>\%?)(?P<source>[\w\d.\-\_\\\/\@\*]+)\))?\s*$'
|
||||
)
|
||||
|
||||
def __init__(self):
|
||||
self._current_jar = None
|
||||
self._jars = []
|
||||
|
||||
def write(self, line):
|
||||
# A Preprocessor instance feeds the parser through calls to this method.
|
||||
|
||||
# Ignore comments and empty lines
|
||||
if self.ignore.match(line):
|
||||
return
|
||||
|
||||
# A jar manifest file can declare several different sections, each of
|
||||
# which applies to a given "jar file". Each of those sections starts
|
||||
# with "<name>.jar:".
|
||||
if self._current_jar is None:
|
||||
m = self.jarline.match(line)
|
||||
if not m:
|
||||
raise RuntimeError(line)
|
||||
self._current_jar = JarInfo(m.group('jarfile'))
|
||||
self._jars.append(self._current_jar)
|
||||
return
|
||||
|
||||
# Within each section, there can be three different types of entries:
|
||||
|
||||
# - indications of the relative source directory we pretend to be in
|
||||
# when considering localization files, in the following form;
|
||||
# "relativesrcdir <path>:"
|
||||
m = self.relsrcline.match(line)
|
||||
if m:
|
||||
if self._current_jar.chrome_manifests or self._current_jar.entries:
|
||||
self._current_jar = JarInfo(self._current_jar.name)
|
||||
self._jars.append(self._current_jar)
|
||||
self._current_jar.relativesrcdir = m.group('relativesrcdir')
|
||||
return
|
||||
|
||||
# - chrome manifest entries, prefixed with "%".
|
||||
m = self.regline.match(line)
|
||||
if m:
|
||||
rline = m.group(1)
|
||||
if rline not in self._current_jar.chrome_manifests:
|
||||
self._current_jar.chrome_manifests.append(rline)
|
||||
return
|
||||
|
||||
# - entries indicating files to be part of the given jar. They are
|
||||
# formed thusly:
|
||||
# "<dest_path>"
|
||||
# or
|
||||
# "<dest_path> (<source_path>)"
|
||||
# The <dest_path> is where the file(s) will be put in the chrome jar.
|
||||
# The <source_path> is where the file(s) can be found in the source
|
||||
# directory. The <source_path> may start with a "%" for files part
|
||||
# of a localization directory, in which case the "%" counts as the
|
||||
# locale.
|
||||
# Each entry can be prefixed with "*" for preprocessing and "+" to
|
||||
# always overwrite the destination independently of file timestamps
|
||||
# (the usefulness of the latter is dubious in the modern days).
|
||||
m = self.entryline.match(line)
|
||||
if m:
|
||||
self._current_jar.entries.append(JarManifestEntry(
|
||||
m.group('output'),
|
||||
m.group('source') or mozpath.basename(m.group('output')),
|
||||
is_locale=bool(m.group('locale')),
|
||||
preprocess=bool(m.group('optPreprocess')),
|
||||
overwrite=bool(m.group('optOverwrite')),
|
||||
))
|
||||
return
|
||||
|
||||
self._current_jar = None
|
||||
self.write(line)
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self._jars)
|
||||
|
||||
|
||||
class JarMaker(object):
|
||||
'''JarMaker reads jar.mn files and process those into jar files or
|
||||
flat directories, along with chrome.manifest files.
|
||||
'''
|
||||
|
||||
def __init__(self, outputFormat='flat', useJarfileManifest=True,
|
||||
useChromeManifest=False):
|
||||
|
||||
@@ -200,28 +290,9 @@ class JarMaker(object):
|
||||
'''updateManifest replaces the % in the chrome registration entries
|
||||
with the given chrome base path, and updates the given manifest file.
|
||||
'''
|
||||
|
||||
ensureParentDir(manifestPath)
|
||||
lock = lock_file(manifestPath + '.lck')
|
||||
try:
|
||||
myregister = dict.fromkeys(map(lambda s: s.replace('%',
|
||||
chromebasepath), register.iterkeys()))
|
||||
manifestExists = os.path.isfile(manifestPath)
|
||||
mode = manifestExists and 'r+b' or 'wb'
|
||||
mf = open(manifestPath, mode)
|
||||
if manifestExists:
|
||||
# import previous content into hash, ignoring empty ones and comments
|
||||
imf = re.compile('(#.*)?$')
|
||||
for l in re.split('[\r\n]+', mf.read()):
|
||||
if imf.match(l):
|
||||
continue
|
||||
myregister[l] = None
|
||||
mf.seek(0)
|
||||
for k in sorted(myregister.iterkeys()):
|
||||
mf.write(k + os.linesep)
|
||||
mf.close()
|
||||
finally:
|
||||
lock = None
|
||||
myregister = dict.fromkeys(map(lambda s: s.replace('%',
|
||||
chromebasepath), register))
|
||||
addEntriesToListFile(manifestPath, myregister.iterkeys())
|
||||
|
||||
def makeJar(self, infile, jardir):
|
||||
'''makeJar is the main entry point to JarMaker.
|
||||
@@ -243,24 +314,11 @@ class JarMaker(object):
|
||||
logging.info('processing ' + infile)
|
||||
self.sourcedirs.append(_normpath(os.path.dirname(infile)))
|
||||
pp = self.pp.clone()
|
||||
pp.out = StringIO()
|
||||
pp.out = JarManifestParser()
|
||||
pp.do_include(infile)
|
||||
lines = PushbackIter(pp.out.getvalue().splitlines())
|
||||
try:
|
||||
while True:
|
||||
l = lines.next()
|
||||
m = self.jarline.match(l)
|
||||
if not m:
|
||||
raise RuntimeError(l)
|
||||
if m.group('jarfile') is None:
|
||||
# comment
|
||||
continue
|
||||
self.processJarSection(m.group('jarfile'), lines,
|
||||
jardir)
|
||||
except StopIteration:
|
||||
# we read the file
|
||||
pass
|
||||
return
|
||||
|
||||
for info in pp.out:
|
||||
self.processJarSection(info, jardir)
|
||||
|
||||
def generateLocaleDirs(self, relativesrcdir):
|
||||
if os.path.basename(relativesrcdir) == 'locales':
|
||||
@@ -281,25 +339,21 @@ class JarMaker(object):
|
||||
relativesrcdir, 'en-US'))
|
||||
return locdirs
|
||||
|
||||
def processJarSection(self, jarfile, lines, jardir):
|
||||
def processJarSection(self, jarinfo, jardir):
|
||||
'''Internal method called by makeJar to actually process a section
|
||||
of a jar.mn file.
|
||||
|
||||
jarfile is the basename of the jarfile or the directory name for
|
||||
flat output, lines is a PushbackIter of the lines of jar.mn,
|
||||
the remaining options are carried over from makeJar.
|
||||
'''
|
||||
|
||||
# chromebasepath is used for chrome registration manifests
|
||||
# {0} is getting replaced with chrome/ for chrome.manifest, and with
|
||||
# an empty string for jarfile.manifest
|
||||
|
||||
chromebasepath = '{0}' + os.path.basename(jarfile)
|
||||
chromebasepath = '{0}' + os.path.basename(jarinfo.name)
|
||||
if self.outputFormat == 'jar':
|
||||
chromebasepath = 'jar:' + chromebasepath + '.jar!'
|
||||
chromebasepath += '/'
|
||||
|
||||
jarfile = os.path.join(jardir, jarfile)
|
||||
jarfile = os.path.join(jardir, jarinfo.name)
|
||||
jf = None
|
||||
if self.outputFormat == 'jar':
|
||||
# jar
|
||||
@@ -314,59 +368,24 @@ class JarMaker(object):
|
||||
else:
|
||||
outHelper = getattr(self, 'OutputHelper_'
|
||||
+ self.outputFormat)(jarfile)
|
||||
register = {}
|
||||
|
||||
# This loop exits on either
|
||||
# - the end of the jar.mn file
|
||||
# - an line in the jar.mn file that's not part of a jar section
|
||||
# - on an exception raised, close the jf in that case in a finally
|
||||
if jarinfo.relativesrcdir:
|
||||
self.localedirs = self.generateLocaleDirs(jarinfo.relativesrcdir)
|
||||
|
||||
try:
|
||||
while True:
|
||||
try:
|
||||
l = lines.next()
|
||||
except StopIteration:
|
||||
# we're done with this jar.mn, and this jar section
|
||||
self.finalizeJar(jarfile, chromebasepath, register)
|
||||
if jf is not None:
|
||||
jf.close()
|
||||
for e in jarinfo.entries:
|
||||
self._processEntryLine(e, outHelper, jf)
|
||||
|
||||
# reraise the StopIteration for makeJar
|
||||
raise
|
||||
if self.ignore.match(l):
|
||||
continue
|
||||
m = self.relsrcline.match(l)
|
||||
if m:
|
||||
relativesrcdir = m.group('relativesrcdir')
|
||||
self.localedirs = \
|
||||
self.generateLocaleDirs(relativesrcdir)
|
||||
continue
|
||||
m = self.regline.match(l)
|
||||
if m:
|
||||
rline = m.group(1)
|
||||
register[rline] = 1
|
||||
continue
|
||||
m = self.entryline.match(l)
|
||||
if not m:
|
||||
# neither an entry line nor chrome reg, this jar section is done
|
||||
self.finalizeJar(jarfile, chromebasepath, register)
|
||||
if jf is not None:
|
||||
jf.close()
|
||||
lines.pushback(l)
|
||||
return
|
||||
self._processEntryLine(m, outHelper, jf)
|
||||
finally:
|
||||
if jf is not None:
|
||||
jf.close()
|
||||
return
|
||||
self.finalizeJar(jarfile, chromebasepath, jarinfo.chrome_manifests)
|
||||
if jf is not None:
|
||||
jf.close()
|
||||
|
||||
def _processEntryLine(self, m, outHelper, jf):
|
||||
out = m.group('output')
|
||||
src = m.group('source') or os.path.basename(out)
|
||||
def _processEntryLine(self, e, outHelper, jf):
|
||||
out = e.output
|
||||
src = e.source
|
||||
|
||||
# pick the right sourcedir -- l10n, topsrc or src
|
||||
|
||||
if m.group('locale'):
|
||||
if e.is_locale:
|
||||
src_base = self.localedirs
|
||||
elif src.startswith('/'):
|
||||
# path/in/jar/file_name.xul (/path/in/sourcetree/file_name.xul)
|
||||
@@ -379,26 +398,22 @@ class JarMaker(object):
|
||||
src_base = self.sourcedirs + [os.getcwd()]
|
||||
|
||||
if '*' in src:
|
||||
if not out.endswith('/'):
|
||||
out += '/'
|
||||
def _prefix(s):
|
||||
for p in s.split('/'):
|
||||
if '*' not in p:
|
||||
yield p + '/'
|
||||
prefix = ''.join(_prefix(src))
|
||||
fmt = '%s%s %s%%s (%s%%s)' % (
|
||||
m.group('optPreprocess') or '',
|
||||
m.group('optOverwrite') or '',
|
||||
out,
|
||||
m.group('locale').replace('%', '%%') or '',
|
||||
)
|
||||
for _srcdir in src_base:
|
||||
finder = FileFinder(_srcdir, find_executables=False)
|
||||
for path, _ in finder.find(src):
|
||||
line = fmt % (path[len(prefix):], path)
|
||||
m = self.entryline.match(line)
|
||||
if m:
|
||||
self._processEntryLine(m, outHelper, jf)
|
||||
e = JarManifestEntry(
|
||||
mozpath.join(out, path[len(prefix):]),
|
||||
path,
|
||||
is_locale=e.is_locale,
|
||||
preprocess=e.preprocess,
|
||||
overwrite=e.overwrite
|
||||
)
|
||||
self._processEntryLine(e, outHelper, jf)
|
||||
return
|
||||
|
||||
# check if the source file exists
|
||||
@@ -412,7 +427,7 @@ class JarMaker(object):
|
||||
jf.close()
|
||||
raise RuntimeError('File "{0}" not found in {1}'.format(src,
|
||||
', '.join(src_base)))
|
||||
if m.group('optPreprocess'):
|
||||
if e.preprocess:
|
||||
outf = outHelper.getOutput(out)
|
||||
inf = open(realsrc)
|
||||
pp = self.pp.clone()
|
||||
@@ -427,8 +442,8 @@ class JarMaker(object):
|
||||
|
||||
# copy or symlink if newer or overwrite
|
||||
|
||||
if m.group('optOverwrite') or getModTime(realsrc) \
|
||||
> outHelper.getDestModTime(m.group('output')):
|
||||
if e.overwrite or getModTime(realsrc) \
|
||||
> outHelper.getDestModTime(e.output):
|
||||
if self.outputFormat == 'symlink':
|
||||
outHelper.symlink(realsrc, out)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user