summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/installer/packager.py
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-11-14 01:03:27 +0000
committerMoonchild <moonchild@palemoon.org>2020-11-18 10:58:48 +0000
commit8b3375e2c202c04935ca056cc8dc389a08e47bb6 (patch)
tree6dbbbdfd28f5b70f7d9b7fad0af7a8fee7e5019f /toolkit/mozapps/installer/packager.py
parent8fefeee3c3e4ff5195a98496c3855d8aabce4ffa (diff)
downloadUXP-8b3375e2c202c04935ca056cc8dc389a08e47bb6.tar
UXP-8b3375e2c202c04935ca056cc8dc389a08e47bb6.tar.gz
UXP-8b3375e2c202c04935ca056cc8dc389a08e47bb6.tar.lz
UXP-8b3375e2c202c04935ca056cc8dc389a08e47bb6.tar.xz
UXP-8b3375e2c202c04935ca056cc8dc389a08e47bb6.zip
[packager] Optimize archive accesses.
Diffstat (limited to 'toolkit/mozapps/installer/packager.py')
-rw-r--r--toolkit/mozapps/installer/packager.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/toolkit/mozapps/installer/packager.py b/toolkit/mozapps/installer/packager.py
index 1a144823c..3b90e97c2 100644
--- a/toolkit/mozapps/installer/packager.py
+++ b/toolkit/mozapps/installer/packager.py
@@ -23,6 +23,7 @@ from mozpack.copier import (
Jarrer,
)
from mozpack.errors import errors
+from mozpack.mozjar import JAR_BROTLI
from mozpack.unify import UnifiedBuildFinder
import mozpack.path as mozpath
import buildconfig
@@ -270,9 +271,9 @@ def main():
help='Enable jar optimizations')
parser.add_argument('--unify', default='',
help='Base directory of another build to unify with')
- parser.add_argument('--disable-compression', action='store_false',
- dest='compress', default=True,
- help='Disable jar compression')
+ parser.add_argument('--compress', choices=('none', 'deflate', 'brotli'),
+ default='deflate',
+ help='Use given jar compression (default: deflate)')
parser.add_argument('manifest', default=None, nargs='?',
help='Manifest file name')
parser.add_argument('source', help='Source directory')
@@ -290,15 +291,21 @@ def main():
for name, value in [split_define(d) for d in args.defines]:
defines[name] = value
+ compress = {
+ 'none': False,
+ 'deflate': True,
+ 'brotli': JAR_BROTLI,
+ }[args.compress]
+
copier = FileCopier()
if args.format == 'flat':
formatter = FlatFormatter(copier)
elif args.format == 'jar':
- formatter = JarFormatter(copier, compress=args.compress, optimize=args.optimizejars)
+ formatter = JarFormatter(copier, compress=compress, optimize=args.optimizejars)
elif args.format == 'omni':
formatter = OmniJarFormatter(copier,
buildconfig.substs['OMNIJAR_NAME'],
- compress=args.compress,
+ compress=compress,
optimize=args.optimizejars,
non_resources=args.non_resource)
else: