From a5c8345ee6793228265c2358e3449b89610e3d8f Mon Sep 17 00:00:00 2001 From: Adrian Stratulat Date: Tue, 22 Sep 2020 19:31:37 +0200 Subject: [PATCH] repos: remove trailing slash from layer path In order for oe-core to correctly display the layers and revisions used in a build, the paths used in conf/bblayers.conf must have no trailing path separator. Signed-off-by: Adrian Stratulat [Jan: fix overlong line, update test case] Signed-off-by: Jan Kiszka --- kas/repos.py | 3 ++- tests/test_layers.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kas/repos.py b/kas/repos.py index 001a4a2..85268bf 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -52,7 +52,8 @@ class Repo: def __getattr__(self, item): if item == 'layers': - return [os.path.join(self.path, layer) for layer in self._layers] + return [os.path.join(self.path, layer).rstrip(os.sep) + for layer in self._layers] elif item == 'qualified_name': url = urlparse(self.url) return ('{url.netloc}{url.path}' diff --git a/tests/test_layers.py b/tests/test_layers.py index 21299ac..098e31c 100644 --- a/tests/test_layers.py +++ b/tests/test_layers.py @@ -42,7 +42,7 @@ def test_layers_default(dokas): match = 0 with open('build/conf/bblayers.conf', 'r') as f: for line in f: - if 'test_layers/kas/' in line: + if 'test_layers/kas ' in line: match += 1 assert(match == 1)