Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tor-reproducer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
tor-reproducer
Commits
2f7db459
Verified
Commit
2f7db459
authored
6 years ago
by
Torsten Grote
Browse files
Options
Downloads
Patches
Plain Diff
Adapt verification to new build file locations
parent
0b3c05fd
No related branches found
No related tags found
1 merge request
!6
Add tor-0.3.5.7
Pipeline
#3029
passed
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
verify-tor.py
+10
-7
10 additions, 7 deletions
verify-tor.py
with
10 additions
and
7 deletions
verify-tor.py
+
10
−
7
View file @
2f7db459
...
...
@@ -3,9 +3,11 @@ import os
import
sys
from
subprocess
import
check_call
,
CalledProcessError
from
utils
import
REPO_DIR
,
get_sha256
,
fail
,
get_build_versions
,
get_final_file_name
,
\
from
utils
import
REPO_DIR
,
get_sha256
,
get_build_versions
,
get_final_file_name
,
\
get_version
,
get_tor_version
REF_DIR
=
"
reference
"
def
main
():
# get Tor version from command or show usage information
...
...
@@ -22,19 +24,20 @@ def verify(version, for_android):
versions
=
get_build_versions
(
version
)
# download reference binary
os
.
makedirs
(
REF_DIR
,
exist_ok
=
True
)
file_name
=
get_final_file_name
(
versions
,
for_android
)
ref_file
=
os
.
path
.
join
(
REF_DIR
,
file_name
)
try
:
# try downloading from jcenter
check_call
([
'
wget
'
,
'
--no-verbose
'
,
get_url
(
versions
,
for_android
),
'
-O
'
,
file_nam
e
])
check_call
([
'
wget
'
,
'
--no-verbose
'
,
get_url
(
versions
,
for_android
),
'
-O
'
,
ref_fil
e
])
except
CalledProcessError
:
# try fallback to bintray
print
(
"
Warning: Download from jcenter failed. Trying bintray directly...
"
)
check_call
([
'
wget
'
,
'
--no-verbose
'
,
get_url
(
versions
,
for_android
,
fallback
=
True
),
'
-O
'
,
file_nam
e
])
ref_fil
e
])
# check if Tor was already build
build_file_name
=
os
.
path
.
join
(
REPO_DIR
,
file_name
)
if
not
os
.
path
.
isfile
(
build_file_name
):
if
not
os
.
path
.
isfile
(
file_name
):
# build Tor
if
version
is
None
:
check_call
([
'
./build-tor.py
'
])
...
...
@@ -42,8 +45,8 @@ def verify(version, for_android):
check_call
([
'
./build-tor.py
'
,
version
])
# calculate hashes for both files
reference_hash
=
get_sha256
(
file_nam
e
)
build_hash
=
get_sha256
(
build_
file_name
)
reference_hash
=
get_sha256
(
ref_fil
e
)
build_hash
=
get_sha256
(
file_name
)
print
(
"
Reference sha256: %s
"
%
reference_hash
)
print
(
"
Build sha256: %s
"
%
build_hash
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment