mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
bitbake: fetch: Extend testing of subdir unpack parameter and fix
This fixes urls of the form file://some/path/file;subdir=b. It also adds in a couple of tests so we now tests these corner cases. (Bitbake rev: 46306912a96444790efa9418d934dfdd36773ba1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -1264,6 +1264,8 @@ class FetchMethod(object):
|
|||||||
# items. So, only do so for file:// entries.
|
# items. So, only do so for file:// entries.
|
||||||
if urldata.type == "file" and urldata.path.find("/") != -1:
|
if urldata.type == "file" and urldata.path.find("/") != -1:
|
||||||
destdir = urldata.path.rsplit("/", 1)[0]
|
destdir = urldata.path.rsplit("/", 1)[0]
|
||||||
|
if urldata.parm.get('subdir') != None:
|
||||||
|
destdir = urldata.parm.get('subdir') + "/" + destdir
|
||||||
else:
|
else:
|
||||||
if urldata.parm.get('subdir') != None:
|
if urldata.parm.get('subdir') != None:
|
||||||
destdir = urldata.parm.get('subdir')
|
destdir = urldata.parm.get('subdir')
|
||||||
|
|||||||
@@ -444,6 +444,13 @@ class FetcherLocalTest(FetcherTest):
|
|||||||
tree = self.fetchUnpack(['file://dir/subdir/e'])
|
tree = self.fetchUnpack(['file://dir/subdir/e'])
|
||||||
self.assertEqual(tree, ['dir/subdir/e'])
|
self.assertEqual(tree, ['dir/subdir/e'])
|
||||||
|
|
||||||
|
def test_local_subdirparam(self):
|
||||||
|
tree = self.fetchUnpack(['file://a;subdir=bar'])
|
||||||
|
self.assertEqual(tree, ['bar/a'])
|
||||||
|
|
||||||
|
def test_local_deepsubdirparam(self):
|
||||||
|
tree = self.fetchUnpack(['file://dir/subdir/e;subdir=bar'])
|
||||||
|
self.assertEqual(tree, ['bar/dir/subdir/e'])
|
||||||
|
|
||||||
class FetcherNetworkTest(FetcherTest):
|
class FetcherNetworkTest(FetcherTest):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user