Skip to content

Commit

Permalink
[packaging] More failure info in update-tiledb-versions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Nov 21, 2024
1 parent ca00d5b commit d55b323
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions scripts/update-tiledb-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import re
import sys
import urllib.error
from fileinput import FileInput
from subprocess import run
from urllib.request import urlopen
Expand All @@ -13,15 +14,19 @@
def hash_url_file(url):
"""Return SHA1 hash of the file located at the provided url."""

print(f"URL {url}", file=sys.stderr)
BLOCK_SIZE = 65536
hash = hashlib.sha1()
with urlopen(url) as fp:
while True:
data = fp.read(BLOCK_SIZE)
if not data:
return hash.hexdigest()
hash.update(data)
try:
with urlopen(url) as fp:
print(f"URL {url}", file=sys.stderr)
while True:
data = fp.read(BLOCK_SIZE)
if not data:
return hash.hexdigest()
hash.update(data)
except urllib.error.HTTPError:
print(f"FAIL {url}", file=sys.stderr)
return None


def get_version_hash(version):
Expand Down

0 comments on commit d55b323

Please sign in to comment.