]> code.ossystems Code Review - openembedded-core.git/commitdiff
bb.fetch2: add urldata_init call for Fetch class
authorYu Ke <ke.yu@intel.com>
Sat, 8 Jan 2011 08:40:18 +0000 (16:40 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 10 Jan 2011 20:21:15 +0000 (20:21 +0000)
FetchData has some fetch method specific data, and only fetch method knows how
to initialize it. originally it is mostly initialized in Fetch.localpath().
But now there is requirement to call Fetch.latest_revision() before
Fetch.localpath(), thus require another earlier place for initialization. so
urldata_init is introduced for this purpose. it will be called in FetchData:__init__
and make all the Fetch functions useable after that.

Signed-off-by: Yu Ke <ke.yu@intel.com>
bitbake/lib/bb/fetch2/__init__.py

index dd6f714d712389495069fef533c83e199332b58f..16cf1fa2be55a356505eb9518e006cf75d64db07 100644 (file)
@@ -546,6 +546,8 @@ class FetchData(object):
         for m in methods:
             if m.supports(url, self, d):
                 self.method = m
+                if hasattr(m,"urldata_init"):
+                    m.urldata_init(self, d)
                 return
         raise NoMethodError("Missing implementation for url %s" % url)