diff options
-rwxr-xr-x | bin/just-mr.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bin/just-mr.py b/bin/just-mr.py index 216c1390..b97e8dc7 100755 --- a/bin/just-mr.py +++ b/bin/just-mr.py @@ -449,9 +449,21 @@ def archive_checkout(desc, repo_type="archive"): try_rmtree(target_tmp) os.makedirs(target_tmp) if repo_type == "zip": - run_cmd(["unzip", "-d", ".", cas_path(content_id)], cwd=target_tmp) + try: + run_cmd(["unzip", "-d", ".", cas_path(content_id)], cwd=target_tmp) + except: + try: + run_cmd(["7z", "x", cas_path(content_id)], cwd=target_tmp) + except: + print("Failed to extract zip-like archive %s" % + (cas_path(content_id), )) + sys.exit(1) else: - run_cmd(["tar", "xf", cas_path(content_id)], cwd=target_tmp) + try: + run_cmd(["tar", "xf", cas_path(content_id)], cwd=target_tmp) + except: + print("Failed to extract tarball %s" % (cas_path(content_id), )) + sys.exit(1) if ALWAYS_FILE: move_to_place(target_tmp, target) return ["file", subdir_path(target, desc)] |