Skip to content
Snippets Groups Projects
Verified Commit 3ad59223 authored by Sebastian's avatar Sebastian
Browse files

Check built files with upstream binaries

parent de1bf332
Branches
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
import os
from shutil import copytree
from subprocess import check_call
import hashlib
import utils
from utils import get_version, get_build_versions, reset_time, \
......@@ -9,6 +10,7 @@ from utils import get_version, get_build_versions, reset_time, \
PLATFORM = "macos"
BUILD_DIR = "tor-browser-build"
UPSTREAM_VERSION = "12.0.6"
def setup(platform):
......@@ -58,5 +60,36 @@ def print_hashes(versions):
print("%s: %s" % (file, sha256hash))
def compare_output_with_upstream():
compare_with_upstream("aarch64")
compare_with_upstream("x86_64")
def compare_with_upstream(arch):
check_call(['wget', '-c', ('https://archive.torproject.org/tor-package-archive/torbrowser/{0}/'
+ 'tor-expert-bundle-{0}-macos-{1}.tar.gz').format(UPSTREAM_VERSION, arch)])
check_call(['tar', 'xvfz', 'tor-expert-bundle-{0}-macos-{1}.tar.gz'.format(UPSTREAM_VERSION, arch),
'--one-top-level=upstream-' + arch, '--strip-components=1',
'tor/tor', 'tor/libevent-2.1.7.dylib'])
hash_tor_upstream = get_sha256(os.path.join('upstream-' + arch, 'tor'))
hash_libevent_upstream = get_sha256(os.path.join('upstream-' + arch, 'libevent-2.1.7.dylib'))
print('upstream tor: {0}'.format(hash_tor_upstream))
print('upstream libevent: {0}'.format(hash_libevent_upstream))
hash_tor_built = get_sha256(os.path.join('output', 'macos', arch, 'tor'))
hash_libevent_built = get_sha256(os.path.join('output', 'macos', arch, 'libevent-2.1.7.dylib'))
print('built tor: {0}'.format(hash_tor_built))
print('built libevent: {0}'.format(hash_libevent_built))
if hash_tor_upstream != hash_tor_built:
print("tor hash does not match")
exit(1)
if hash_libevent_upstream != hash_libevent_built:
print("libevent hash does not match")
exit(1)
if __name__ == "__main__":
build()
compare_output_with_upstream()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment