diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2018-03-15 15:09:51 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-03-16 10:58:02 -0700 |
commit | 2dda429ebd78e44446001190ee496720792d32b4 (patch) | |
tree | 6865259c75ffd8011cd426dcd6b45dcf34134a84 /host/utils/uhd_images_downloader.py.in | |
parent | 0ad86e6cb765ad8896bb1b679a5ee0c26ede1b0a (diff) | |
download | uhd-2dda429ebd78e44446001190ee496720792d32b4.tar.gz uhd-2dda429ebd78e44446001190ee496720792d32b4.tar.bz2 uhd-2dda429ebd78e44446001190ee496720792d32b4.zip |
utils: fixup for downloader SHA256 check
The image package is not unzipped or kept if the SHA256 checksum fails
Diffstat (limited to 'host/utils/uhd_images_downloader.py.in')
-rw-r--r-- | host/utils/uhd_images_downloader.py.in | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in index 4c896c18c..5dffe625e 100644 --- a/host/utils/uhd_images_downloader.py.in +++ b/host/utils/uhd_images_downloader.py.in @@ -358,9 +358,14 @@ def main(): buffer_size=args.buffer_size, print_progress=(_LOG_LEVEL <= _LOG_LEVELS.get("INFO", 3)) ) + # If the check fails, print an error and don't unzip the file if downloaded_sha256 != target_sha256: - log("ERROR", "Downloaded SHA256 does not match manifest for {}!".format( - full_url)) + log("ERROR", "Downloaded SHA256 does not match manifest for {}! " + "The images from this package have not been updated." + .format(full_url)) + continue + # Note: this skips the --keep option, so we'll never keep image packages + # that fail the SHA256 checksum log("TRACE", "{} successfully downloaded ({} Bytes)" .format(temp_path, downloaded_size)) |