summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-01-21 11:16:25 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2025-01-29 16:05:35 +0100
commitda4d4ef676cbe971b80d52a581cf7c8e0869d9ab (patch)
tree91b39c68b14adf0eabe0bb615fa71a24647b53aa
parentb427f99a1f947f668c8197d6b6d1117eb40da438 (diff)
downloadjustbuild-da4d4ef676cbe971b80d52a581cf7c8e0869d9ab.tar.gz
just-lock: Fix deduplication of 'computed' roots
Based on 76ce2123
-rwxr-xr-xbin/just-lock.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/just-lock.py b/bin/just-lock.py
index 65838cf1..75ca7da8 100755
--- a/bin/just-lock.py
+++ b/bin/just-lock.py
@@ -1853,6 +1853,15 @@ def deduplicate(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["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})