mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
oeqa/utils/gitarchive: fall back to local tags when listing existing tags
e9cff55e73has switched tag listing from bare "git tag" to "git ls-remote" to make sure not to miss remote tags which are not fetched locally. This mechanism first checks for configured remote repository, next for possibly passed url, and then fails if none worked. However there are still cases where no remote repository is configured and no url is provided (for instance: buildperf tests use an empty git directory to store tests). Fix those cases by putting back the old behavior (local tags check) as last resort, with at least a warning for future diagnostics if we still encounter tagging issues Fixes:e9cff55e73("oeqa/utils/gitarchive: fix tag computation when creating archive") (From OE-Core rev: 34e1f845687d2f7169f5d6c1bb54e1a7ab5412c4) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
3c1ee6d8b0
commit
db6ace80a0
@@ -116,18 +116,25 @@ def get_tags(repo, log, pattern=None, url=None):
|
||||
cmd.append(pattern)
|
||||
try:
|
||||
tags_refs = repo.run_cmd(cmd)
|
||||
tags = ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]
|
||||
except GitError as e:
|
||||
# If it fails, retry with repository url if one is provided
|
||||
if not url:
|
||||
raise(e)
|
||||
log.info("No remote repository configured, use provided url")
|
||||
cmd = base_cmd.copy()
|
||||
cmd.append(url)
|
||||
if pattern:
|
||||
cmd.append(pattern)
|
||||
tags_refs = repo.run_cmd(cmd)
|
||||
if url:
|
||||
log.info("No remote repository configured, use provided url")
|
||||
cmd = base_cmd.copy()
|
||||
cmd.append(url)
|
||||
if pattern:
|
||||
cmd.append(pattern)
|
||||
tags_refs = repo.run_cmd(cmd)
|
||||
tags = ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]
|
||||
else:
|
||||
log.warning("Read local tags only, some remote tags may be missed")
|
||||
cmd = ["tag"]
|
||||
if pattern:
|
||||
cmd += ["-l", pattern]
|
||||
tags = repo.run_cmd(cmd).splitlines()
|
||||
|
||||
return ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]
|
||||
return tags
|
||||
|
||||
def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern,
|
||||
url, log, keywords):
|
||||
|
||||
Reference in New Issue
Block a user