On 7/31/24 03:03, Daniel P. Berrangé wrote:
+ def __init__(self, url, hash):
+ self.url = url
+ self.hash = hash
+ self.cache_dir = Path(Path("~").expanduser(),
+ ".cache", "qemu", "download")
+ self.cache_file = Path(self.cache_dir,
+ hashlib.sha256(url.encode("utf-8")).hexdigest())
Out of curiosity, why are we hashing the url from which we downloaded?
Why not use the known hash of the contents?
If a url goes stale, and we adjust the url to a new host, we shouldn't need to re-download
just because the url changed.
r~