On Fri, Aug 02, 2024 at 07:51:14AM +1000, Richard Henderson wrote: > 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.
Hmmm, good point, will change it. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|