diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index a73fb79ac8..53fdc4c3df 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -279,6 +279,10 @@ class Git(FetchMethod): | |||
279 | ud.unresolvedrev[name] = ud.revisions[name] | 279 | ud.unresolvedrev[name] = ud.revisions[name] |
280 | ud.revisions[name] = self.latest_revision(ud, d, name) | 280 | ud.revisions[name] = self.latest_revision(ud, d, name) |
281 | 281 | ||
282 | if 'tag' in ud.parm: | ||
283 | if len(ud.revisions) != 1: | ||
284 | raise bb.fetch2.ParameterError("Git fetcher support for multiple tagged revisions not implemented", ud.url) | ||
285 | |||
282 | gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_').replace('(', '_').replace(')', '_')) | 286 | gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_').replace('(', '_').replace(')', '_')) |
283 | if gitsrcname.startswith('.'): | 287 | if gitsrcname.startswith('.'): |
284 | gitsrcname = gitsrcname[1:] | 288 | gitsrcname = gitsrcname[1:] |
@@ -747,6 +751,14 @@ class Git(FetchMethod): | |||
747 | if not source_found: | 751 | if not source_found: |
748 | raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url) | 752 | raise bb.fetch2.UnpackError("No up to date source found: " + "; ".join(source_error), ud.url) |
749 | 753 | ||
754 | # If there is a tag parameter in the url and we also have a fixed srcrev, check the tag | ||
755 | # matches the revision | ||
756 | if 'tag' in ud.parm and sha1_re.match(ud.revision): | ||
757 | output = runfetchcmd("%s rev-list -n 1 %s" % (ud.basecmd, ud.parm['tag']), d, workdir=destdir) | ||
758 | output = output.strip() | ||
759 | if output != ud.revision: | ||
760 | raise bb.fetch2.FetchError("The revision the git tag '%s' resolved to didn't match the SRCREV in use (%s vs %s)" % (ud.parm['tag'], output, ud.revision), ud.url) | ||
761 | |||
750 | repourl = self._get_repo_url(ud) | 762 | repourl = self._get_repo_url(ud) |
751 | runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, shlex.quote(repourl)), d, workdir=destdir) | 763 | runfetchcmd("%s remote set-url origin %s" % (ud.basecmd, shlex.quote(repourl)), d, workdir=destdir) |
752 | 764 | ||