summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-12 17:48:54 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-18 17:08:08 +0000
commit498de0473709414961873333b9473ad5a922d78c (patch)
treebe0374d6d379bbd8f71c389ae42b54d7b76c7a0a /bitbake/lib
parentba82035412d5dec2ce6f8a459ee52da48b1afe32 (diff)
downloadast2050-yocto-poky-498de0473709414961873333b9473ad5a922d78c.zip
ast2050-yocto-poky-498de0473709414961873333b9473ad5a922d78c.tar.gz
bitbake: fetch2/git: Improve handling of unresolved names verses branches
Currently the fetcher doesn't distinguish between names that the fetcher needs to resolve verses branch names that the user specified. This meant that if you specify a tag and a branch, the fetcher broke. This separates the two so that the branch name is preserved and can be used in appropriate places. (Bitbake rev: e85f39fe9d1b224414b5da0780da514f75c5df92) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/git.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 00a459d..c391b38 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -106,6 +106,7 @@ class Git(FetchMethod):
if ud.bareclone:
ud.nocheckout = 1
+ ud.unresolvedrev = {}
branches = ud.parm.get("branch", "master").split(',')
if len(branches) != len(ud.names):
raise bb.fetch2.ParameterError("The number of name and branch parameters is not balanced", ud.url)
@@ -113,6 +114,7 @@ class Git(FetchMethod):
for name in ud.names:
branch = branches[ud.names.index(name)]
ud.branches[name] = branch
+ ud.unresolvedrev[name] = branch
ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
@@ -124,7 +126,7 @@ class Git(FetchMethod):
# Ensure anything that doesn't look like a sha256 checksum/revision is translated into one
if not ud.revisions[name] or len(ud.revisions[name]) != 40 or (False in [c in "abcdef0123456789" for c in ud.revisions[name]]):
if ud.revisions[name]:
- ud.branches[name] = ud.revisions[name]
+ ud.unresolvedrev[name] = ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud, d, name)
gitsrcname = '%s%s' % (ud.host.replace(':','.'), ud.path.replace('/', '.').replace('*', '.'))
@@ -300,7 +302,7 @@ class Git(FetchMethod):
"""
Return a unique key for the url
"""
- return "git:" + ud.host + ud.path.replace('/', '.') + ud.branches[name]
+ return "git:" + ud.host + ud.path.replace('/', '.') + ud.unresolvedrev[name]
def _latest_revision(self, ud, d, name):
"""
@@ -313,7 +315,7 @@ class Git(FetchMethod):
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
cmd = "%s ls-remote %s://%s%s%s %s" % \
- (basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name])
+ (basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name])
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, cmd)
output = runfetchcmd(cmd, d, True)
OpenPOWER on IntegriCloud