summaryrefslogtreecommitdiff
path: root/install-xpi
diff options
context:
space:
mode:
authorJérémy Bobbio <lunar@debian.org>2015-06-01 18:09:47 +0200
committerJérémy Bobbio <lunar@debian.org>2015-06-01 18:09:47 +0200
commit3ac63335cda3292eb811af54e7d728a239540ef7 (patch)
treea1ef461e0fd8edf7a0b36a84f85c3b4d86899cbd /install-xpi
parent1419d0226868500f869a42940382970921c56794 (diff)
Use UTC as timezone when calling zip or unzip
Zip standard specify that files are stored with localtime. This unfortunately make the builds vary needlessly when run on different timezone.
Diffstat (limited to 'install-xpi')
-rwxr-xr-xinstall-xpi3
1 files changed, 3 insertions, 0 deletions
diff --git a/install-xpi b/install-xpi
index 3601038..4e7c674 100755
--- a/install-xpi
+++ b/install-xpi
@@ -156,6 +156,9 @@ def install_xpi(script_name, package, xpi_file, exclude, install_dir, links,
# create directory and extract xpi file
if not os.path.isdir(copy_dir):
os.makedirs(copy_dir)
+ # With unzip, the mtime of created files will depend on the timezone,
+ # which prevents reproducible builds. Let's make it UTC before unzipping.
+ os.environ['TZ'] = 'UTC'
command = ["unzip", "-o", "-d", copy_dir, xpi_file]
if len(exclude) > 0:
command.append("-x")