summaryrefslogtreecommitdiff
path: root/bin/just-mr.py
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-08-14 11:38:45 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-08-14 15:09:11 +0200
commit89f854e1c5533bc49c59e7b5ab839463615df5c9 (patch)
treeaa486fffcd7858e80962612b5f0307e00ca92998 /bin/just-mr.py
parentd95a7a4bb8d00a2e994bee82f4f64b2ed1d9ec12 (diff)
downloadjustbuild-89f854e1c5533bc49c59e7b5ab839463615df5c9.tar.gz
just-mr py: Add support for 7zip archives
Diffstat (limited to 'bin/just-mr.py')
-rwxr-xr-xbin/just-mr.py16
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)]