diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index db1e286371..39dfd474b3 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -827,37 +827,36 @@ class Git(FetchMethod): | |||
827 | """ | 827 | """ |
828 | pupver = ('', '') | 828 | pupver = ('', '') |
829 | 829 | ||
830 | tagregex = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P<pver>([0-9][\.|_]?)+)") | ||
831 | try: | 830 | try: |
832 | output = self._lsremote(ud, d, "refs/tags/*") | 831 | output = self._lsremote(ud, d, "refs/tags/*") |
833 | except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess) as e: | 832 | except (bb.fetch2.FetchError, bb.fetch2.NetworkAccess) as e: |
834 | bb.note("Could not list remote: %s" % str(e)) | 833 | bb.note("Could not list remote: %s" % str(e)) |
835 | return pupver | 834 | return pupver |
836 | 835 | ||
836 | pver_re = re.compile(d.getVar('UPSTREAM_CHECK_GITTAGREGEX') or r"(?P<pver>([0-9][\.|_]?)+)") | ||
837 | nonrel_re = re.compile(r"(alpha|beta|rc|final)+") | ||
838 | |||
837 | verstring = "" | 839 | verstring = "" |
838 | revision = "" | ||
839 | for line in output.split("\n"): | 840 | for line in output.split("\n"): |
840 | if not line: | 841 | if not line: |
841 | break | 842 | break |
842 | 843 | ||
843 | tag_head = line.split("/")[-1] | 844 | tag = line.split("/")[-1] |
844 | # Ignore non-released branches | 845 | # Ignore non-released branches |
845 | m = re.search(r"(alpha|beta|rc|final)+", tag_head) | 846 | if nonrel_re.search(tag): |
846 | if m: | ||
847 | continue | 847 | continue |
848 | 848 | ||
849 | # search for version in the line | 849 | # search for version in the line |
850 | tag = tagregex.search(tag_head) | 850 | m = pver_re.search(tag) |
851 | if tag is None: | 851 | if not m: |
852 | continue | 852 | continue |
853 | 853 | ||
854 | tag = tag.group('pver') | 854 | pver = m.group('pver').replace("_", ".") |
855 | tag = tag.replace("_", ".") | ||
856 | 855 | ||
857 | if verstring and bb.utils.vercmp(("0", tag, ""), ("0", verstring, "")) < 0: | 856 | if verstring and bb.utils.vercmp(("0", pver, ""), ("0", verstring, "")) < 0: |
858 | continue | 857 | continue |
859 | 858 | ||
860 | verstring = tag | 859 | verstring = pver |
861 | revision = line.split()[0] | 860 | revision = line.split()[0] |
862 | pupver = (verstring, revision) | 861 | pupver = (verstring, revision) |
863 | 862 | ||