summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py2
-rw-r--r--bitbake/lib/bb/tests/fetch.py7
2 files changed, 9 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 68c8329e2b..87cf7e61a6 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1264,6 +1264,8 @@ class FetchMethod(object):
1264 # items. So, only do so for file:// entries. 1264 # items. So, only do so for file:// entries.
1265 if urldata.type == "file" and urldata.path.find("/") != -1: 1265 if urldata.type == "file" and urldata.path.find("/") != -1:
1266 destdir = urldata.path.rsplit("/", 1)[0] 1266 destdir = urldata.path.rsplit("/", 1)[0]
1267 if urldata.parm.get('subdir') != None:
1268 destdir = urldata.parm.get('subdir') + "/" + destdir
1267 else: 1269 else:
1268 if urldata.parm.get('subdir') != None: 1270 if urldata.parm.get('subdir') != None:
1269 destdir = urldata.parm.get('subdir') 1271 destdir = urldata.parm.get('subdir')
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 7df7a0ef51..d95b43a5e3 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -444,6 +444,13 @@ class FetcherLocalTest(FetcherTest):
444 tree = self.fetchUnpack(['file://dir/subdir/e']) 444 tree = self.fetchUnpack(['file://dir/subdir/e'])
445 self.assertEqual(tree, ['dir/subdir/e']) 445 self.assertEqual(tree, ['dir/subdir/e'])
446 446
447 def test_local_subdirparam(self):
448 tree = self.fetchUnpack(['file://a;subdir=bar'])
449 self.assertEqual(tree, ['bar/a'])
450
451 def test_local_deepsubdirparam(self):
452 tree = self.fetchUnpack(['file://dir/subdir/e;subdir=bar'])
453 self.assertEqual(tree, ['bar/dir/subdir/e'])
447 454
448class FetcherNetworkTest(FetcherTest): 455class FetcherNetworkTest(FetcherTest):
449 456