summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2017-06-01 09:31:17 +0000
committerintrigeri <intrigeri@boum.org>2017-06-01 09:31:17 +0000
commita2bdfa7d717b69fb9c6d413b6ff83add49ba8bd7 (patch)
tree0223ddee2462ecd1c31d86594049e3c7c5ae1656
parent269c84873972047e32ff7ac0796da96aaf9bf23e (diff)
parent7c0e5aed243bcf29334be63a9dd9d813793b71e4 (diff)
Merge branch 'testing' into feature/5630-deterministic-builds
-rwxr-xr-xconfig/chroot_local-hooks/10-tbb21
1 files changed, 16 insertions, 5 deletions
diff --git a/config/chroot_local-hooks/10-tbb b/config/chroot_local-hooks/10-tbb
index a5a8e4c..f41a092 100755
--- a/config/chroot_local-hooks/10-tbb
+++ b/config/chroot_local-hooks/10-tbb
@@ -118,9 +118,13 @@ EOF
# TBB works around the lack of code signing for its extensions by
# hacking in exceptions. We do the same!
apply_extension_code_signing_hacks () {
- local destination tmp
+ local destination tmp tbb_timestamp
destination="${1}"
+ # For consistency we'll set timestamps of files we modify to the
+ # same one used by the Tor Browser instead of SOURCE_DATE_EPOCH.
+ tbb_timestamp="$(date --date='2000-01-01 00:00:00' +%s)"
+
tmp="$(mktemp -d)"
(
cd "${tmp}"
@@ -156,7 +160,9 @@ diff -Naur a/modules/addons/XPIProvider.jsm b/modules/addons/XPIProvider.jsm
return true;
}
EOF
- 7z u -tzip "${TBB_INSTALL}/omni.ja" \
+ touch --date="@${tbb_timestamp}" modules/addons/XPIProvider.jsm \
+ chrome/toolkit/content/mozapps/extensions/extensions.js
+ 7z u -mtc=off -tzip "${TBB_INSTALL}/omni.ja" \
modules/addons/XPIProvider.jsm \
chrome/toolkit/content/mozapps/extensions/extensions.js
@@ -178,16 +184,21 @@ diff -Naur x/components/nsBrowserGlue.js y/components/nsBrowserGlue.js
break;
}
EOF
- 7z u -tzip "${TBB_INSTALL}/browser/omni.ja" \
+ touch --date="@${tbb_timestamp}" components/nsBrowserGlue.js
+ 7z u -mtc=off -tzip "${TBB_INSTALL}/browser/omni.ja" \
components/nsBrowserGlue.js
# These binaries are generated from the above modified files
# so we have to remove them. This will have a performance
# impact that probably is unnoticeable for humans, but TBB 7.5
# won't ship any of these binaries any way, so we'll converge.
- 7z d -tzip "${TBB_INSTALL}/omni.ja" \
+ 7z d -mtc=off -tzip "${TBB_INSTALL}/omni.ja" \
jsloader/resource/gre/modules/addons/XPIProvider.jsm
- 7z d -tzip "${TBB_INSTALL}/browser/omni.ja" \
+ 7z d -mtc=off -tzip "${TBB_INSTALL}/browser/omni.ja" \
jsloader/resource/app/components/nsBrowserGlue.js
+ for archive in "${TBB_INSTALL}/omni.ja" "${TBB_INSTALL}/browser/omni.ja"; do
+ strip_nondeterminism_wrapper --type zip --timestamp "${tbb_timestamp}" \
+ "${archive}" 2>/dev/null
+ done
)
}