summaryrefslogtreecommitdiff
path: root/bin/just-deduplicate-repos.py
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2025-01-08 13:25:45 +0100
committerMaksim Denisov <denisov.maksim@huawei.com>2025-01-08 18:10:19 +0100
commit76ce2123c79c2e1405b71c694cf35b7019835ac7 (patch)
treeaa5f87386f40fb6695b55533ac7f50cc358b7e79 /bin/just-deduplicate-repos.py
parent7d0a4df3822ca194d93abb6b65d0ebb264cc1974 (diff)
downloadjustbuild-76ce2123c79c2e1405b71c694cf35b7019835ac7.tar.gz
Fix deduplication of target repos in precomputed roots
Diffstat (limited to 'bin/just-deduplicate-repos.py')
-rwxr-xr-xbin/just-deduplicate-repos.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/just-deduplicate-repos.py b/bin/just-deduplicate-repos.py
index 9d0f69c1..25186b08 100755
--- a/bin/just-deduplicate-repos.py
+++ b/bin/just-deduplicate-repos.py
@@ -276,6 +276,15 @@ def dedup(repos: Json, user_keep: List[str]) -> Json:
if isinstance(root_val, str) and (root_val in renaming):
new_roots[root] = final_root_reference(root_val)
desc = dict(desc, **new_roots)
+
+ # Update target repos of precomputed roots:
+ if isinstance(desc.get("repository"), dict):
+ repo_root: Json = desc.get("repository")
+ if repo_root["type"] == "computed" and \
+ repo_root["repo"] in renaming:
+ repo_root = \
+ dict(repo_root, **{"repo": renaming[repo_root["repo"]]})
+ desc = dict(desc, **{"repository": repo_root})
new_repos[name] = desc
return dict(repos, **{"repositories": new_repos})