summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Middelschulte <leif.middelschulte@klsmartin.com>2020-09-24 15:07:19 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-25 08:32:02 +0100
commitcd1795287ae9a5df0f25472cd50f4355f6eecb7f (patch)
tree9a257e227efb0577a95fe2b9fbbe0a084c09ea55
parentb1dff146a66e4a8da194205de1210572d8929192 (diff)
downloadpoky-cd1795287ae9a5df0f25472cd50f4355f6eecb7f.tar.gz
bitbake: tests/fetch: backslash support in file:// URIs
Implements backslashes in local filenames. A typical usecase for such a filename is a systemd unit. Example: `dev-disk-by\x2dlabel-FOO.device` (Bitbake rev: 14a35f273b579d5cd5fd92765b89c28f870dd577) Signed-off-by: Leif Middelschulte <leif.middelschulte@klsmartin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/tests/fetch.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 5f24918a96..5a4db9ca4c 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -599,6 +599,7 @@ class FetcherLocalTest(FetcherTest):
599 touch(os.path.join(self.localsrcdir, 'dir', 'd')) 599 touch(os.path.join(self.localsrcdir, 'dir', 'd'))
600 os.makedirs(os.path.join(self.localsrcdir, 'dir', 'subdir')) 600 os.makedirs(os.path.join(self.localsrcdir, 'dir', 'subdir'))
601 touch(os.path.join(self.localsrcdir, 'dir', 'subdir', 'e')) 601 touch(os.path.join(self.localsrcdir, 'dir', 'subdir', 'e'))
602 touch(os.path.join(self.localsrcdir, r'backslash\x2dsystemd-unit.device'))
602 self.d.setVar("FILESPATH", self.localsrcdir) 603 self.d.setVar("FILESPATH", self.localsrcdir)
603 604
604 def fetchUnpack(self, uris): 605 def fetchUnpack(self, uris):
@@ -616,6 +617,10 @@ class FetcherLocalTest(FetcherTest):
616 tree = self.fetchUnpack(['file://a', 'file://dir/c']) 617 tree = self.fetchUnpack(['file://a', 'file://dir/c'])
617 self.assertEqual(tree, ['a', 'dir/c']) 618 self.assertEqual(tree, ['a', 'dir/c'])
618 619
620 def test_local_backslash(self):
621 tree = self.fetchUnpack([r'file://backslash\x2dsystemd-unit.device'])
622 self.assertEqual(tree, [r'backslash\x2dsystemd-unit.device'])
623
619 def test_local_wildcard(self): 624 def test_local_wildcard(self):
620 with self.assertRaises(bb.fetch2.ParameterError): 625 with self.assertRaises(bb.fetch2.ParameterError):
621 tree = self.fetchUnpack(['file://a', 'file://dir/*']) 626 tree = self.fetchUnpack(['file://a', 'file://dir/*'])