Skip to content

Commit e5999d7

Browse files
committed
Add better comments and clean up
1 parent 9ed5100 commit e5999d7

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

utils/create_xpi.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env python
22

3+
# Uses the Python zip implementation to create deterministic XPI's
4+
# Author: Yan Zhu, yan@mit.edu
5+
36
import os
47
import zipfile
58
import sys
@@ -34,16 +37,17 @@ def createTmpZipInfo():
3437

3538
def constructZipDet():
3639
"""
37-
Create a deterministic zip by setting timestamps and
38-
system/version info to hard-coded values.
40+
Create a deterministic zip by setting timestamps,
41+
operating system, and pkzip version info to hard-coded
42+
values. See the pkzip specification at
43+
https://www.pkware.com/documents/casestudies/APPNOTE.TXT
3944
"""
4045
tmpInfo = createTmpZipInfo()
4146
for info in tmpInfo:
4247
info.date_time = time.gmtime(1378343307)
43-
info.create_system = 3
48+
info.create_system = 3 # aka, UNIX
4449
info.create_version = 20
4550
info.extract_version = 20
46-
print("adding to zip: "+info.filename)
4751
xpiFile.writestr(info, open(info.filename).read())
4852

4953
constructZipDet()

0 commit comments

Comments
 (0)