diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2015-07-14 19:30:57 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-22 08:23:49 +0100 |
commit | bd5167d154ac04dbecbda3a157ae8ef6304e0b4e (patch) | |
tree | cd5928ca4f7f3f460836f07806c5fbe6a83a12dc /bitbake/lib/bb/fetch2 | |
parent | 4bbc5dd6e7454cc35c263707453a6725bc0d54a5 (diff) | |
download | openembedded-core-contrib-bd5167d154ac04dbecbda3a157ae8ef6304e0b4e.tar.gz |
bitbake: fetch2/git.py: latest_versionstring now returns (version, revision)
We need to know the revision associated with the upstream version in
SCM like git, this change broke return convention, oe-core recipeutils
get_recipe_upstream_version need to be updated.
tests/fetch.py: Updated git latest_versionstring test for comply new
convention.
[YOCTO #7605]
(Bitbake rev: fd175dc90024c503134c11cbd83e77d88c406ac8)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 706fff5691..374d846798 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py @@ -371,25 +371,28 @@ class Git(FetchMethod): by searching through the tags output of ls-remote, comparing versions and returning the highest match. """ - verstring = "" + pupver = ('', '') + tagregex = re.compile(d.getVar('GITTAGREGEX', True) or "(?P<pver>([0-9][\.|_]?)+)") try: output = self._lsremote(ud, d, "refs/tags/*") except bb.fetch2.FetchError or bb.fetch2.NetworkAccess: - return "" + return pupver + verstring = "" + revision = "" for line in output.split("\n"): if not line: break - line = line.split("/")[-1] + tag_head = line.split("/")[-1] # Ignore non-released branches - m = re.search("(alpha|beta|rc|final)+", line) + m = re.search("(alpha|beta|rc|final)+", tag_head) if m: continue # search for version in the line - tag = tagregex.search(line) + tag = tagregex.search(tag_head) if tag == None: continue @@ -398,9 +401,12 @@ class Git(FetchMethod): if verstring and bb.utils.vercmp(("0", tag, ""), ("0", verstring, "")) < 0: continue + verstring = tag + revision = line.split()[0] + pupver = (verstring, revision) - return verstring + return pupver def _build_revision(self, ud, d, name): return ud.revisions[name] |