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

Signed-off-by: Yu Ke <ke.yu@intel.com>
This commit is contained in:
Yu Ke 2010-12-27 09:50:25 +08:00 committed by Richard Purdie
parent 2892cbfb11
commit 54e34f6e25
1 changed files with 9 additions and 4 deletions

View File

@ -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