From: Chen Qi <[email protected]>
We want to be able to do stable version upgrade for recipes. For
example, 1.0.0 -> 1.0.1 instead of 1.0.0 -> 1.1.0.
To to this, we need an extra paramter to latest_versionstring
so that we are able to filter out the versions we need. Using regex
has the advantage of adapting to different version schemes.
Signed-off-by: Chen Qi <[email protected]>
---
lib/bb/fetch2/git.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 01bebb764..1e132c502 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -972,7 +972,7 @@ class Git(FetchMethod):
raise bb.fetch2.FetchError("Unable to resolve '%s' in upstream git repository in git ls-remote output for %s" % \
(ud.unresolvedrev, ud.host+ud.path))
- def latest_versionstring(self, ud, d):
+ def latest_versionstring(self, ud, d, filter_regex=None):
"""
Compute the latest release name like "x.y.x" in "x.y.x+gitHASH"
by searching through the tags output of ls-remote, comparing
@@ -1012,6 +1012,10 @@ class Git(FetchMethod):
pver = m.group('pver').replace("_", ".")
+ if filter_regex:
+ if not re.match(filter_regex, pver):
+ continue
+
if verstring and bb.utils.vercmp(("0", pver, ""), ("0", verstring, "")) < 0:
continue
--
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.