@@ -505,6 +505,14 @@ def setup_tools_tarball(ourconfig, btdir, bttarball, name="buildtools"):
# that a freshly-published tarball is always picked up.
if os.path.getmtime(bttarball) > os.path.getmtime(btdlpath):
os.unlink(btdlpath)
+ elif not bttarball.startswith("/") and os.path.exists(btdlpath):
+ # HTTPS/FTP source with no SHA256: there is no way to
+ # verify the cached copy is current, so force a
+ # re-download every run. Add a sha256=<hash> suffix to
+ # the URL in your config to avoid this.
+ print("WARNING: no SHA256 provided for %s source %s; "
+ "forcing re-download to avoid using a stale cached copy"
+ % (name, bttarball))
os.unlink(btdlpath)
if not os.path.exists(btdlpath):
if bttarball.startswith("/"):