From 1f4e75143a961665cf3010e9b0c6d480bbbe022a Mon Sep 17 00:00:00 2001 From: Roxana Date: Thu, 31 Jul 2014 13:29:24 +0300 Subject: bitbake: fetch: SRC_URI parameter "subdir" does not work for local files Check if the 'subdir' parameter exists and assign it to 'destdir' so that files are copied in ${WORKDIR}/destdir. This fixes urls that are of the form file://a;subdir=b. (Bitbake rev: 836a986b365eb9798563ec08d90b346596de7791) Signed-off-by: Roxana Ciobanu Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index df2f2b0..68c8329 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -1265,7 +1265,10 @@ class FetchMethod(object): if urldata.type == "file" and urldata.path.find("/") != -1: destdir = urldata.path.rsplit("/", 1)[0] else: - destdir = "." + if urldata.parm.get('subdir') != None: + destdir = urldata.parm.get('subdir') + else: + destdir = "." bb.utils.mkdirhier("%s/%s" % (rootdir, destdir)) cmd = 'cp -f %s %s/%s/' % (file, rootdir, destdir) -- cgit v1.1