build: improve error message when NDK SHA-256 does not match

This commit is contained in:
Hans-Christoph Steiner 2022-04-26 10:25:04 +02:00
parent e678df14ce
commit 189ff9cd7b
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA

View file

@ -4341,8 +4341,9 @@ def _install_ndk(ndk):
os.path.basename(url) os.path.basename(url)
) )
net.download_file(url, zipball) net.download_file(url, zipball)
if sha256 != sha256sum(zipball): calced = sha256sum(zipball)
raise FDroidException('SHA-256 %s does not match expected for %s' % (sha256, url)) if sha256 != calced:
raise FDroidException('SHA-256 %s does not match expected for %s (%s)' % (calced, url, sha256))
logging.info(_('Unzipping to %s') % ndk_base) logging.info(_('Unzipping to %s') % ndk_base)
with zipfile.ZipFile(zipball) as zipfp: with zipfile.ZipFile(zipball) as zipfp:
for info in zipfp.infolist(): for info in zipfp.infolist():