Do not remove the file and fail if there is no sha256 specified.

This allow us to change the dependency version to change and make
the checksum latter.
This commit is contained in:
Matthieu Gautier 2017-01-10 15:30:37 +01:00
parent e1ad05783e
commit 59f2222ef7
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,9 @@ class BuildEnv:
raise SkipCommand()
os.remove(file_path)
urllib.request.urlretrieve(file_url, file_path)
if what.sha256 != get_sha256(file_path):
if not what.sha256:
print('Sha256 for {} not set, do no verify download'.format(what.name))
elif what.sha256 != get_sha256(file_path):
os.remove(file_path)
raise StopBuild()