File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
36import os
47import zipfile
58import sys
@@ -34,16 +37,17 @@ def createTmpZipInfo():
3437
3538def 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
4953constructZipDet ()
You can’t perform that action at this time.
0 commit comments