Renamed sublayers back to layers
It was decided that 'sublayers' is to confusing, because this term is not used in the bitbake/openembedded context. Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
parent
33a21c8d0d
commit
c950de46f9
@ -113,7 +113,7 @@ Currently there is supports for JSON and Yaml.
|
||||
{ "url": "" },
|
||||
{ "url": "https://git.yoctoproject.org/git/poky",
|
||||
"refspec": "krogoth",
|
||||
"sublayers": [ "meta", "meta-poky", "meta-yocto-bsp"]}
|
||||
"layers": [ "meta", "meta-poky", "meta-yocto-bsp"]}
|
||||
]
|
||||
}
|
||||
```
|
||||
@ -156,7 +156,7 @@ def get_repos(target):
|
||||
repos.append(Repo(
|
||||
url='https://git.yoctoproject.org/git/poky',
|
||||
refspec='krogoth',
|
||||
sublayers=['meta', 'meta-poky', 'meta-yocto-bsp'])))
|
||||
layers=['meta', 'meta-poky', 'meta-yocto-bsp'])))
|
||||
|
||||
return repos
|
||||
```
|
||||
|
@ -289,9 +289,9 @@ class ConfigStatic(Config):
|
||||
repos = []
|
||||
for repo in self._config['repos']:
|
||||
try:
|
||||
sublayers = repo['sublayers']
|
||||
layers = repo['layers']
|
||||
except KeyError:
|
||||
sublayers = None
|
||||
layers = None
|
||||
|
||||
url = repo['url']
|
||||
if url == '':
|
||||
@ -304,14 +304,14 @@ class ConfigStatic(Config):
|
||||
url = output.strip()
|
||||
rep = Repo(url=url,
|
||||
path=url,
|
||||
sublayers=sublayers)
|
||||
layers=layers)
|
||||
rep.disable_git_operations()
|
||||
else:
|
||||
name = os.path.basename(os.path.splitext(url)[0])
|
||||
rep = Repo(url=url,
|
||||
path=os.path.join(self.kas_work_dir, name),
|
||||
refspec=repo['refspec'],
|
||||
sublayers=sublayers)
|
||||
layers=layers)
|
||||
repos.append(rep)
|
||||
|
||||
return repos
|
||||
|
11
kas/repos.py
11
kas/repos.py
@ -35,11 +35,11 @@ class Repo:
|
||||
Represents a repository in the kas configuration.
|
||||
"""
|
||||
|
||||
def __init__(self, url, path, refspec=None, sublayers=None):
|
||||
def __init__(self, url, path, refspec=None, layers=None):
|
||||
self.url = url
|
||||
self.path = path
|
||||
self.refspec = refspec
|
||||
self.sublayers = sublayers
|
||||
self._layers = layers
|
||||
self.name = os.path.basename(self.path)
|
||||
self.git_operation_disabled = False
|
||||
|
||||
@ -51,10 +51,10 @@ class Repo:
|
||||
|
||||
def __getattr__(self, item):
|
||||
if item == 'layers':
|
||||
if not self.sublayers:
|
||||
if not self._layers:
|
||||
return [self.path]
|
||||
else:
|
||||
return [self.path + '/' + l for l in self.sublayers]
|
||||
return [self.path + '/' + l for l in self._layers]
|
||||
elif item == 'qualified_name':
|
||||
url = urlparse(self.url)
|
||||
return ('{url.netloc}{url.path}'
|
||||
@ -65,4 +65,5 @@ class Repo:
|
||||
.replace('*', '.'))
|
||||
|
||||
def __str__(self):
|
||||
return '%s:%s %s' % (self.url, self.refspec, self.sublayers)
|
||||
return '%s:%s %s %s' % (self.url, self.refspec,
|
||||
self.path, self._layers)
|
||||
|
Loading…
Reference in New Issue
Block a user