Patchwork [1/1] SRC_URI parameter: "subdir" does not work for local files

login
register
mail settings
Submitter Roxana
Date July 31, 2014, 10:29 a.m.
Message ID <a6a9bbd35ef333407ed5ea297effba0ae596450a.1406802531.git.roxana.ciobanu@intel.com>
Download mbox | patch
Permalink /patch/77027/
State New
Headers show

Comments

Roxana - July 31, 2014, 10:29 a.m.
Check if the 'subdir' parameter exists and assign it to 'destdir' so that
files are copied in ${WORKDIR}/destdir.

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 bitbake/lib/bb/fetch2/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch

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)