aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/tests/fetch.py
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-24 22:34:42 +0100
commit14a35f273b579d5cd5fd92765b89c28f870dd577 (patch)
tree963b56d030ff0bbd7ed112577ee36caaa76a8c82 /lib/bb/tests/fetch.py
parentaa857fa2e9cf3b0e43a9049b04ec4b0b3c779b11 (diff)
downloadbitbake-14a35f273b579d5cd5fd92765b89c28f870dd577.tar.gz
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` Signed-off-by: Leif Middelschulte <leif.middelschulte@klsmartin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/tests/fetch.py')
-rw-r--r--lib/bb/tests/fetch.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 5f24918a9..5a4db9ca4 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -599,6 +599,7 @@ class FetcherLocalTest(FetcherTest):
touch(os.path.join(self.localsrcdir, 'dir', 'd'))
os.makedirs(os.path.join(self.localsrcdir, 'dir', 'subdir'))
touch(os.path.join(self.localsrcdir, 'dir', 'subdir', 'e'))
+ touch(os.path.join(self.localsrcdir, r'backslash\x2dsystemd-unit.device'))
self.d.setVar("FILESPATH", self.localsrcdir)
def fetchUnpack(self, uris):
@@ -616,6 +617,10 @@ class FetcherLocalTest(FetcherTest):
tree = self.fetchUnpack(['file://a', 'file://dir/c'])
self.assertEqual(tree, ['a', 'dir/c'])
+ def test_local_backslash(self):
+ tree = self.fetchUnpack([r'file://backslash\x2dsystemd-unit.device'])
+ self.assertEqual(tree, [r'backslash\x2dsystemd-unit.device'])
+
def test_local_wildcard(self):
with self.assertRaises(bb.fetch2.ParameterError):
tree = self.fetchUnpack(['file://a', 'file://dir/*'])