Gerrit build uses a python script to download materials: tools/download_file.py. It has at least a couple issues:
- it always cache to the home directory (~) but should really honor XDG_CACHE_HOME
- when the build is interrupted, a truncated cached file might have been saved and the script choke on the checksum mismatch. It should instead discard the faulty file from the cache and retry.