mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 01:42:58 +01:00
test: Avoid duplicate curl call in get_previous_releases.py
This commit is contained in:
parent
55d663cb15
commit
fa5aeab3cb
@ -133,20 +133,9 @@ def download_binary(tag, args) -> int:
|
|||||||
|
|
||||||
print('Fetching: {tarballUrl}'.format(tarballUrl=tarballUrl))
|
print('Fetching: {tarballUrl}'.format(tarballUrl=tarballUrl))
|
||||||
|
|
||||||
header, status = subprocess.Popen(
|
ret = subprocess.run(['curl', '--fail', '--remote-name', tarballUrl]).returncode
|
||||||
['curl', '--head', tarballUrl], stdout=subprocess.PIPE).communicate()
|
if ret:
|
||||||
if re.search("404 Not Found", header.decode("utf-8")):
|
return ret
|
||||||
print("Binary tag was not found")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
curlCmds = [
|
|
||||||
['curl', '--remote-name', tarballUrl]
|
|
||||||
]
|
|
||||||
|
|
||||||
for cmd in curlCmds:
|
|
||||||
ret = subprocess.run(cmd).returncode
|
|
||||||
if ret:
|
|
||||||
return ret
|
|
||||||
|
|
||||||
hasher = hashlib.sha256()
|
hasher = hashlib.sha256()
|
||||||
with open(tarball, "rb") as afile:
|
with open(tarball, "rb") as afile:
|
||||||
|
Loading…
Reference in New Issue
Block a user