summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Smith <daniel.smith@qt.io>2022-04-28 10:07:48 +0200
committerDaniel Smith <Daniel.Smith@qt.io>2022-05-04 12:10:10 +0000
commit91f7a12fded004b74271878cf80235e669acbdb1 (patch)
tree4d1cebd88ac7726a5f50a430ac8af7515c5bbb52
parent10d4124a82b1c52dbd35639e20895bb111b58245 (diff)
Handle yocto/meta-qt6 LTS branches as public branches
If the script is being run with a tqtc/lts-* branch, this should be consistent across all repos except for yocto/meta-qt6 which has no tqtc/ shadow repo and tqtc/lts-* branches. Handle these branches in the public repo instead. It can be expected that lts branches in the public repo are always prefixed as lts-* This change also includes a drive-by fix to ensure the correct qt5 repo is updated, taking repo prefixes into account. Change-Id: I6a8360a6ea682d96882d137b834eea11188c758f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r--util/dependency_updater/tools/toolbox.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/util/dependency_updater/tools/toolbox.py b/util/dependency_updater/tools/toolbox.py
index 9b3a15c..bdb7b38 100644
--- a/util/dependency_updater/tools/toolbox.py
+++ b/util/dependency_updater/tools/toolbox.py
@@ -813,7 +813,7 @@ def do_try_supermodule_updates(config: Config) -> dict[str, Repo]:
"""Push supermodule updates if needed"""
blocking_repos = [r for r in config.state_data.values() if not r.is_non_blocking]
if not any((r.progress < PROGRESS.DONE or r.progress == PROGRESS.DONE_FAILED_BLOCKING)
- and r.id not in ["qt/qt5", "yocto/meta-qt6"]
+ and r.id not in [f"{config.args.repo_prefix}qt5", "yocto/meta-qt6"]
for r in blocking_repos):
if config.args.update_supermodule:
supermodule = push_supermodule_update(config)
@@ -995,10 +995,14 @@ def push_yocto_update(config: Config, retry: bool = False) -> Repo:
gerrit = config.datasources.gerrit_client
yocto_repo = search_for_repo(config, "yocto/meta-qt6")
filename = "recipes-qt/qt6/qt6-git.inc"
+
if yocto_repo.progress >= PROGRESS.IN_PROGRESS:
return yocto_repo
yocto_repo.is_supermodule = True
- yocto_repo.branch = config.args.branch
+ # LTS branch updates are expected to always use a prefix of tqtc/lts-
+ # but yocto lts branches remain in the public repo, so strip off
+ # the tqtc/ prefix
+ yocto_repo.branch = config.args.branch.removeprefix('tqtc/')
yocto_repo.proposal.change_id, yocto_repo.proposal.change_number \
= search_existing_change(config, yocto_repo, "Update submodule refs")
@@ -1006,6 +1010,7 @@ def push_yocto_update(config: Config, retry: bool = False) -> Repo:
.get_file_content(filename)
old_file = bytes.decode(base64.b64decode(r), "utf-8")
file_lines = old_file.splitlines()
+
# The trial-and error nature of finding submodules can be a bit noisy, so suppress warnings.
config.suppress_warn = True
print("Preparing yocto/meta-qt6 update:")
@@ -1017,11 +1022,15 @@ def push_yocto_update(config: Config, retry: bool = False) -> Repo:
repo_name_maybe_submodule = SRCREV.split("_")[1]
module_name = ""
pinned_submodule_sha = ""
+ # If the module name is hypenated, it may be a submodule. Try to find the parent
+ # and use that sha.
if "-" in repo_name_maybe_submodule:
split = repo_name_maybe_submodule.split("-")
maybe_parent = "-".join(split[:-1])
parent_lines = [l for l in file_lines[:i] if l.startswith(f"SRCREV_{maybe_parent}")]
if parent_lines:
+ # Found a potential parent, run some checks to see if it's a known or
+ # real repository.
parent_line = parent_lines[-1].split(" = ")
module_name = parent_line[0].split("_").pop()
if "-" in module_name:
@@ -1046,7 +1055,7 @@ def push_yocto_update(config: Config, retry: bool = False) -> Repo:
f"Trying {repo_name_maybe_submodule} as a regular module instead.")
module_name = repo_name_maybe_submodule
submodule_name = ""
- else:
+ else: # Expected to be just a regular module
module_name = repo_name_maybe_submodule
module_repo = search_for_repo(config, module_name)
if not module_repo.original_ref: