diff options
Diffstat (limited to 'python/mozbuild/mozpack/packager')
-rw-r--r-- | python/mozbuild/mozpack/packager/l10n.py | 6 | ||||
-rw-r--r-- | python/mozbuild/mozpack/packager/unpack.py | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/python/mozbuild/mozpack/packager/l10n.py b/python/mozbuild/mozpack/packager/l10n.py index 758064f59..e3e05fc89 100644 --- a/python/mozbuild/mozpack/packager/l10n.py +++ b/python/mozbuild/mozpack/packager/l10n.py @@ -37,6 +37,7 @@ from mozpack.chrome.manifest import ( Manifest, ) from mozpack.errors import errors +from mozpack.mozjar import JAR_DEFLATED from mozpack.packager.unpack import UnpackFinder from createprecomplete import generate_precomplete @@ -241,16 +242,17 @@ def repack(source, l10n, extra_l10n={}, non_resources=[], non_chrome=set()): finders[base] = UnpackFinder(path) l10n_finder = ComposedFinder(finders) copier = FileCopier() + compress = min(app_finder.compressed, JAR_DEFLATED) if app_finder.kind == 'flat': formatter = FlatFormatter(copier) elif app_finder.kind == 'jar': formatter = JarFormatter(copier, optimize=app_finder.optimizedjars, - compress=app_finder.compressed) + compress=compress) elif app_finder.kind == 'omni': formatter = OmniJarFormatter(copier, app_finder.omnijar, optimize=app_finder.optimizedjars, - compress=app_finder.compressed, + compress=compress, non_resources=non_resources) with errors.accumulate(): diff --git a/python/mozbuild/mozpack/packager/unpack.py b/python/mozbuild/mozpack/packager/unpack.py index fa2b474e7..515705c0d 100644 --- a/python/mozbuild/mozpack/packager/unpack.py +++ b/python/mozbuild/mozpack/packager/unpack.py @@ -54,7 +54,7 @@ class UnpackFinder(BaseFinder): self.omnijar = None self.jarlogs = {} self.optimizedjars = False - self.compressed = True + self.compressed = False jars = set() @@ -146,8 +146,7 @@ class UnpackFinder(BaseFinder): jar = JarReader(fileobj=file.open()) if jar.is_optimized: self.optimizedjars = True - if not any(f.compressed for f in jar): - self.compressed = False + self.compressed = max(self.compressed, jar.compression) if jar.last_preloaded: jarlog = jar.entries.keys() self.jarlogs[path] = jarlog[:jarlog.index(jar.last_preloaded) + 1] |