base.bbclass: use bb.fetch2 unpack API

Signed-off-by: Yu Ke <ke.yu@intel.com>
This commit is contained in:
Yu Ke
2011-01-18 22:38:34 +08:00
committed by Richard Purdie
parent f12e714845
commit 8615b0e282

View File

@@ -256,7 +256,13 @@ python base_do_unpack() {
continue
local = os.path.realpath(local)
lf = bb.utils.lockfile(urldata[url].lockfile)
ret = oe_unpack_file(local, localdata, url)
if bb.fetch.__version__ == "1":
ret = oe_unpack_file(local, localdata, url)
else:
# use bb.fetch2 unpack API
ud = urldata[url]
rootdir = bb.data.getVar('WORKDIR', localdata, True)
ret = ud.method.unpack(ud, rootdir, localdata)
bb.utils.unlockfile(lf)
if not ret:
raise bb.build.FuncFailed("oe_unpack_file failed with return value %s" % ret)