summaryrefslogtreecommitdiff
path: root/tools/adoptopenjdk-manifest
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2022-01-31 10:13:43 -0500
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2022-01-31 10:13:43 -0500
commit4546d7cfd9fba1e01641452b4137cfd2183d6fec (patch)
tree386563a19d74fed5ae9cdfe5bc5fb7db42c3f7d6 /tools/adoptopenjdk-manifest
parent4e443b8eb58ecb11333f35a548569db9ca332be3 (diff)
downloadgentoo-overlay-4546d7cfd9fba1e01641452b4137cfd2183d6fec.tar.xz
gentoo-overlay-4546d7cfd9fba1e01641452b4137cfd2183d6fec.zip
tools/adoptopenjdk-manifest: add follow_redirects, raise_for_status
Diffstat (limited to 'tools/adoptopenjdk-manifest')
-rwxr-xr-xtools/adoptopenjdk-manifest6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/adoptopenjdk-manifest b/tools/adoptopenjdk-manifest
index 1789fdf..c286527 100755
--- a/tools/adoptopenjdk-manifest
+++ b/tools/adoptopenjdk-manifest
@@ -10,14 +10,16 @@ import httpx
import portage
async def do_manifest(client, filename, size, url):
- resp = await client.get(f'{url}.sha256.txt')
+ resp = await client.get(f'{url}.sha256.txt', follow_redirects=True)
+ resp.raise_for_status()
sha256 = resp.text.split(' ')[0]
return (filename, size, sha256)
async def do_api(client, ghauth, tagl):
owner, repo, tag = tagl
apiurl = f'https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}'
- resp = await client.get(apiurl, auth=ghauth)
+ resp = await client.get(apiurl, auth=ghauth, follow_redirects=True)
+ resp.raise_for_status()
return {asset['browser_download_url']: asset['size']
for asset in resp.json()['assets']}