aboutsummaryrefslogtreecommitdiffstats
path: root/host/utils
diff options
context:
space:
mode:
Diffstat (limited to 'host/utils')
-rw-r--r--host/utils/uhd_images_downloader.py.in18
1 files changed, 13 insertions, 5 deletions
diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in
index 11f8ad39b..48f444d45 100644
--- a/host/utils/uhd_images_downloader.py.in
+++ b/host/utils/uhd_images_downloader.py.in
@@ -462,12 +462,20 @@ def main():
# Otherwise, the check has succeeded, and we can proceed
delete_from_inv(target_info, inventory, images_dir)
- archive_namelist = extract(temp_path, images_dir, archive_type, args.test)
- if args.keep:
- # If the user wants to keep the downloaded archive,
- # save it to the images directory and add it to the inventory
+ if os.path.splitext(temp_path)[1].lower() == '.zip':
+ archive_namelist = extract(
+ temp_path,
+ images_dir,
+ archive_type,
+ args.test)
+ if args.keep:
+ # If the user wants to keep the downloaded archive,
+ # save it to the images directory and add it to the inventory
+ shutil.copy(temp_path, images_dir)
+ archive_namelist.append(filename)
+ else:
+ archive_namelist = []
shutil.copy(temp_path, images_dir)
- archive_namelist.append(filename)
inventory[target_name] = {"repo_hash": target_hash,
"contents": archive_namelist,
"filename": filename}