From d25f6b970fbe252d947082a46f7d84490ddcd7da Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Mon, 19 Feb 2024 01:38:05 +0100 Subject: bitbake: fetch2/git: Make latest_versionstring extract tags with slashes correctly Before, everything up to the last slash was removed when extracting the names of the tags. This would lead to that a tag such as "agent/11.0.0" would be incorrectly identified as "11.0.0", which would then be treated as a correct version matching "^(?P\d+(\.\d+)+)". (Bitbake rev: 8b21024b9966d5158ac4a77e87ffb935c2a57764) Signed-off-by: Peter Kjellerstedt Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/git.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/bb/fetch2/git.py') diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 39dfd474b3..df33fb6aeb 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -833,6 +833,7 @@ class Git(FetchMethod): bb.note("Could not list remote: %s" % str(e)) return pupver + rev_tag_re = re.compile(r"([0-9a-f]{40})\s+refs/tags/(.*)") pver_re = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P([0-9][\.|_]?)+)") nonrel_re = re.compile(r"(alpha|beta|rc|final)+") @@ -841,7 +842,12 @@ class Git(FetchMethod): if not line: break - tag = line.split("/")[-1] + m = rev_tag_re.match(line) + if not m: + continue + + (revision, tag) = m.groups() + # Ignore non-released branches if nonrel_re.search(tag): continue @@ -857,7 +863,6 @@ class Git(FetchMethod): continue verstring = pver - revision = line.split()[0] pupver = (verstring, revision) return pupver -- cgit v1.2.3-54-g00ecf