Skip to content

Commit 1d39348

Browse files
committed
Compress during zip
1 parent 5d2e09f commit 1d39348

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

utils/create_xpi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#!/usr/bin/env python
2+
13
import os
24
import zipfile
35
import sys
46
import time
57
import glob
8+
import zlib
69

710
xpiName = sys.argv[1]
811
exclusionsFile = sys.argv[2]
@@ -25,14 +28,14 @@ def createTmpZipInfo():
2528
for fi in files:
2629
filename = os.path.join(root,fi)
2730
if filename not in map(lambda x: './'+x, exclusions):
28-
xpiFileTmp.write(filename)
31+
xpiFileTmp.write(filename, compress_type=zipfile.ZIP_DEFLATED)
2932
xpiFileTmp.close()
3033
return xpiFileTmp.infolist()
3134

3235
def constructZipDet():
3336
"""
3437
Create a deterministic zip by setting timestamps and
35-
system/version info to hard-coded values
38+
system/version info to hard-coded values.
3639
"""
3740
tmpInfo = createTmpZipInfo()
3841
for info in tmpInfo:

0 commit comments

Comments
 (0)