aboutsummaryrefslogtreecommitdiff
path: root/test/get_previous_releases.py
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-08-23 14:13:33 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-08-23 14:07:31 +0200
commitfa5aeab3cb18405ecf8a1401d89539b924a618f6 (patch)
treeddbca29eb27ec789f72d4984bf4464f3ec42e3a0 /test/get_previous_releases.py
parent55d663cb15151773cd043fc9535d6245f8ba6c99 (diff)
test: Avoid duplicate curl call in get_previous_releases.py
Diffstat (limited to 'test/get_previous_releases.py')
-rwxr-xr-xtest/get_previous_releases.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/test/get_previous_releases.py b/test/get_previous_releases.py
index 459693102b..1d397e721e 100755
--- a/test/get_previous_releases.py
+++ b/test/get_previous_releases.py
@@ -133,20 +133,9 @@ def download_binary(tag, args) -> int:
print('Fetching: {tarballUrl}'.format(tarballUrl=tarballUrl))
- header, status = subprocess.Popen(
- ['curl', '--head', tarballUrl], stdout=subprocess.PIPE).communicate()
- if re.search("404 Not Found", header.decode("utf-8")):
- 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
+ ret = subprocess.run(['curl', '--fail', '--remote-name', tarballUrl]).returncode
+ if ret:
+ return ret
hasher = hashlib.sha256()
with open(tarball, "rb") as afile: