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 <jan.kiszka@siemens.com>
This commit is contained in:
parent
acdb774d67
commit
f678b24611
@ -51,9 +51,7 @@ class Repo:
|
|||||||
|
|
||||||
def __getattr__(self, item):
|
def __getattr__(self, item):
|
||||||
if item == 'layers':
|
if item == 'layers':
|
||||||
if not self._layers:
|
return [os.path.join(self.path, layer) for layer in self._layers]
|
||||||
return [self.path]
|
|
||||||
return [self.path + '/' + layer for layer in self._layers]
|
|
||||||
elif item == 'qualified_name':
|
elif item == 'qualified_name':
|
||||||
url = urlparse(self.url)
|
url = urlparse(self.url)
|
||||||
return ('{url.netloc}{url.path}'
|
return ('{url.netloc}{url.path}'
|
||||||
@ -84,7 +82,7 @@ class Repo:
|
|||||||
"""
|
"""
|
||||||
Returns a Repo instance depending on params.
|
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:
|
layers = list(filter(lambda x, laydict=layers_dict:
|
||||||
str(laydict[x]).lower() not in
|
str(laydict[x]).lower() not in
|
||||||
['disabled', 'excluded', 'n', 'no', '0', 'false'],
|
['disabled', 'excluded', 'n', 'no', '0', 'false'],
|
||||||
|
Loading…
Reference in New Issue
Block a user