diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2022-06-22 14:25:59 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2022-06-23 16:11:51 +0200 |
commit | 43a719d87ef57566393f1dafa9419a978e66954f (patch) | |
tree | 2507fe110553c87a989a6dc29ff2f1c5e455eb3c | |
parent | 087d307b035ad2a59e90e13e1ef22ec88cd99fb1 (diff) | |
download | justbuild-43a719d87ef57566393f1dafa9419a978e66954f.tar.gz |
Fix handling of existing tmp paths in just-mr
-rwxr-xr-x | bin/just-mr.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/just-mr.py b/bin/just-mr.py index 3e898901..28bf46c7 100755 --- a/bin/just-mr.py +++ b/bin/just-mr.py @@ -179,6 +179,8 @@ def git_checkout(desc): (branch, repo, commit)) git_keep(commit, upstream=repo) if ALWAYS_FILE: + if os.path.exists(target): + shutil.rmtree(target) os.makedirs(target) with tempfile.TemporaryFile() as f: run_cmd(["git", "archive", commit], cwd=root, stdout=f) @@ -317,6 +319,8 @@ def archive_checkout(desc, repo_type="archive", *, fetch_only=False): return if not ALWAYS_FILE: target = archive_tmp_checkout_dir(content_id, repo_type=repo_type) + if os.path.exists(target): + shutil.rmtree(target) os.makedirs(target) if repo_type == "zip": run_cmd(["unzip", "-d", ".", cas_path(content_id)], cwd=target) @@ -459,6 +463,8 @@ def distdir_checkout(desc, repos): ] # Create the dirstdir repo folder content + if os.path.exists(target_distdir_dir): + shutil.rmtree(target_distdir_dir) os.makedirs(target_distdir_dir) for name, content_id in content.items(): target = os.path.join(target_distdir_dir, name) |