]> code.ossystems Code Review - openembedded-core.git/commitdiff
base.bbclass: use bb.fetch2 unpack API
authorYu Ke <ke.yu@intel.com>
Tue, 18 Jan 2011 14:38:34 +0000 (22:38 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Jan 2011 12:25:47 +0000 (12:25 +0000)
Signed-off-by: Yu Ke <ke.yu@intel.com>
meta/classes/base.bbclass

index 583f9b775fc6c8b695583682a450b6924eafb8a5..ec55d4aa726471c69295ffe3361249be8595b0e9 100644 (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)