summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorYu Ke <ke.yu@intel.com>2010-12-27 09:50:25 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:35:46 +0000
commit190896c09522e78052f067557777186f75bfd6c8 (patch)
tree31637daf7e0baa8e69c32db26efd3257207248b5 /lib/bb/fetch2/git.py
parentffc1cf8bdbd439f70fda35e64ab7b174914b5479 (diff)
downloadbitbake-190896c09522e78052f067557777186f75bfd6c8.tar.gz
bb.fetch2.git.py: add git urldata_init
move the git specific urldata init from localpath to urldata_init so that it can be called early (From Poky rev: 54e34f6e255d1717beada23638a5783c9dda42ea) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/git.py')
-rw-r--r--lib/bb/fetch2/git.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index e8ad3b43c..58ed1f410 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -41,8 +41,11 @@ class Git(Fetch):
"""
return ud.type in ['git']
- def localpath(self, url, ud, d):
-
+ def urldata_init(self, ud, d):
+ """
+ init git specific variable within url data
+ so that the git method like latest_revision() can work
+ """
if 'protocol' in ud.parm:
ud.proto = ud.parm['protocol']
elif not ud.host:
@@ -56,6 +59,10 @@ class Git(Fetch):
ud.mirrortarball = 'git_%s.tar.gz' % (gitsrcname)
ud.clonedir = os.path.join(data.expand('${GITDIR}', d), gitsrcname)
+ ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
+
+ def localpath(self, url, ud, d):
+
tag = Fetch.srcrev_internal_helper(ud, d)
if tag is True:
ud.tag = self.latest_revision(url, ud, d)
@@ -78,8 +85,6 @@ class Git(Fetch):
else:
ud.localfile = data.expand('git_%s%s_%s.tar.gz' % (ud.host, subdirpath.replace('/', '.'), ud.tag), d)
- ud.basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
-
if 'noclone' in ud.parm:
ud.localfile = None
return None