Commit 100f9f04 authored by Torsten Grote's avatar Torsten Grote

Use our version tag instead upstream version

This way we can do multiple builds of the same upstream version
parent 6d2bbb37
Pipeline #3721 passed with stages
in 53 minutes and 50 seconds
......@@ -3,7 +3,7 @@ import os
from shutil import move, copy, rmtree
from subprocess import check_call
from utils import REPO_DIR, get_sha256, fail, get_build_versions, get_tor_version, \
from utils import REPO_DIR, get_sha256, fail, get_build_versions, get_version_tag, \
get_final_file_name, get_sources_file_name, get_pom_file_name, get_version
......@@ -281,13 +281,13 @@ def create_sources_jar(versions):
def create_pom_file(versions, android=False):
tor_version = get_tor_version(versions)
version = get_version_tag(versions)
pom_name = get_pom_file_name(versions, android)
template = 'template-android.pom' if android else 'template.pom'
with open(template, 'rt') as infile:
with open(pom_name, 'wt') as outfile:
for line in infile:
outfile.write(line.replace('VERSION', tor_version))
outfile.write(line.replace('VERSION', version))
return pom_name
......@@ -22,6 +22,7 @@ def get_build_versions(tag):
if tag is None:
# take top-most Tor version
tag = next(iter(versions))
versions[tag]['tag'] = tag
return versions[tag]
......@@ -38,12 +39,12 @@ def get_sha256(filename, block_size=65536):
return sha256.hexdigest()
def get_tor_version(versions):
return versions['tor'].split('-')[1]
def get_version_tag(versions):
return versions['tag']
def get_file_suffix(versions, android=False):
version = get_tor_version(versions)
version = get_version_tag(versions)
return "%s-%s" % ("android", version) if android else version
......@@ -3,8 +3,8 @@ import os
import sys
from subprocess import check_call, CalledProcessError
from utils import REPO_DIR, get_sha256, get_build_versions, get_final_file_name, \
get_version, get_tor_version
from utils import get_sha256, get_build_versions, get_final_file_name, \
get_version, get_version_tag
REF_DIR = "reference"
......@@ -53,7 +53,7 @@ def verify(version, for_android):
# compare hashes
suffix = " for Android" if for_android else ""
if reference_hash == build_hash:
print("Tor%s version %s was successfully verified! \o/" % (suffix, versions['tor']))
print("Tor%s version %s was successfully verified! \\o/" % (suffix, versions['tor']))
return True
print("Hashes for Tor%s version %s do not match! :(" % (suffix, versions['tor']))
......@@ -61,7 +61,7 @@ def verify(version, for_android):
def get_url(versions, for_android, fallback=False):
version = get_tor_version(versions)
version = get_version_tag(versions)
directory = "tor-android" if for_android else "tor"
file = get_final_file_name(versions, for_android)
if not fallback:
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment