diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-01-09 10:09:56 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-01-09 11:22:18 +0100 |
commit | 22ef0a1617fcfaf3e89407b6b9c50b46a04ac8a7 (patch) | |
tree | ebb0faf38f31e2e5058cbac04583329dbc50bbdf | |
parent | 8c2b4b603c81d7dc699ff4cbb52787cdfec87b64 (diff) | |
download | justbuild-22ef0a1617fcfaf3e89407b6b9c50b46a04ac8a7.tar.gz |
Support deduplication of "tree structure" roots
-rwxr-xr-x | bin/just-deduplicate-repos.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/just-deduplicate-repos.py b/bin/just-deduplicate-repos.py index 25186b08..9b3f9407 100755 --- a/bin/just-deduplicate-repos.py +++ b/bin/just-deduplicate-repos.py @@ -69,10 +69,11 @@ def bisimilar_repos(repos: Json) -> List[List[str]]: elif a["type"] == "git": return (a["commit"] == b["commit"] and a.get("subdir", ".") == b.get("subdir", ".")) - elif a["type"] == "computed": - if (a.get("config", {}) != b.get("config", {}) - or a["target"] != b["target"]): - return False + elif a["type"] in ["computed", "tree structure"]: + if a["type"] == "computed": + if (a.get("config", {}) != b.get("config", {}) + or a["target"] != b["target"]): + return False if a["repo"] == b["repo"]: return True elif is_different(a["repo"], b["repo"]): @@ -280,7 +281,7 @@ def dedup(repos: Json, user_keep: List[str]) -> Json: # Update target repos of precomputed roots: if isinstance(desc.get("repository"), dict): repo_root: Json = desc.get("repository") - if repo_root["type"] == "computed" and \ + if repo_root["type"] in ["computed", "tree structure"] and \ repo_root["repo"] in renaming: repo_root = \ dict(repo_root, **{"repo": renaming[repo_root["repo"]]}) |