From f678b2461163112bb7040348079effb693709c83 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Thu, 2 Jul 2020 07:42:23 +0200 Subject: [PATCH] repos: Allow for layer-free repositories While we support layers: .: excluded this is effectively the same as leaving out the layers property: The repository itself will always be added as layer to bblayers.conf. This prevents using kas to checkout layer-free repositories as well, e.g. bitbake in case oe-core is used. Add support for that be converting a non-existing layers property into layers: .: internally and removing the special case from Repo.layers which assumed that layers=None meant the above. Closes: #16 Signed-off-by: Jan Kiszka --- kas/repos.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kas/repos.py b/kas/repos.py index 56bc54f..0031814 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -51,9 +51,7 @@ class Repo: def __getattr__(self, item): if item == 'layers': - if not self._layers: - return [self.path] - return [self.path + '/' + layer for layer in self._layers] + return [os.path.join(self.path, layer) for layer in self._layers] elif item == 'qualified_name': url = urlparse(self.url) return ('{url.netloc}{url.path}' @@ -84,7 +82,7 @@ class Repo: """ Returns a Repo instance depending on params. """ - layers_dict = repo_config.get('layers', {}) + layers_dict = repo_config.get('layers', {'': None}) layers = list(filter(lambda x, laydict=layers_dict: str(laydict[x]).lower() not in ['disabled', 'excluded', 'n', 'no', '0', 'false'],