|
| From: | Richard Henderson |
| Subject: | Re: [PATCH v3 08/24] tests/functional: add a module for handling asset download & caching |
| Date: | Fri, 2 Aug 2024 07:51:14 +1000 |
| User-agent: | Mozilla Thunderbird |
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~
| [Prev in Thread] | Current Thread | [Next in Thread] |