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": "" },
|
||||||
{ "url": "https://git.yoctoproject.org/git/poky",
|
{ "url": "https://git.yoctoproject.org/git/poky",
|
||||||
"refspec": "krogoth",
|
"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(
|
repos.append(Repo(
|
||||||
url='https://git.yoctoproject.org/git/poky',
|
url='https://git.yoctoproject.org/git/poky',
|
||||||
refspec='krogoth',
|
refspec='krogoth',
|
||||||
sublayers=['meta', 'meta-poky', 'meta-yocto-bsp'])))
|
layers=['meta', 'meta-poky', 'meta-yocto-bsp'])))
|
||||||
|
|
||||||
return repos
|
return repos
|
||||||
```
|
```
|
||||||
|
@ -289,9 +289,9 @@ class ConfigStatic(Config):
|
|||||||
repos = []
|
repos = []
|
||||||
for repo in self._config['repos']:
|
for repo in self._config['repos']:
|
||||||
try:
|
try:
|
||||||
sublayers = repo['sublayers']
|
layers = repo['layers']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
sublayers = None
|
layers = None
|
||||||
|
|
||||||
url = repo['url']
|
url = repo['url']
|
||||||
if url == '':
|
if url == '':
|
||||||
@ -304,14 +304,14 @@ class ConfigStatic(Config):
|
|||||||
url = output.strip()
|
url = output.strip()
|
||||||
rep = Repo(url=url,
|
rep = Repo(url=url,
|
||||||
path=url,
|
path=url,
|
||||||
sublayers=sublayers)
|
layers=layers)
|
||||||
rep.disable_git_operations()
|
rep.disable_git_operations()
|
||||||
else:
|
else:
|
||||||
name = os.path.basename(os.path.splitext(url)[0])
|
name = os.path.basename(os.path.splitext(url)[0])
|
||||||
rep = Repo(url=url,
|
rep = Repo(url=url,
|
||||||
path=os.path.join(self.kas_work_dir, name),
|
path=os.path.join(self.kas_work_dir, name),
|
||||||
refspec=repo['refspec'],
|
refspec=repo['refspec'],
|
||||||
sublayers=sublayers)
|
layers=layers)
|
||||||
repos.append(rep)
|
repos.append(rep)
|
||||||
|
|
||||||
return repos
|
return repos
|
||||||
|
11
kas/repos.py
11
kas/repos.py
@ -35,11 +35,11 @@ class Repo:
|
|||||||
Represents a repository in the kas configuration.
|
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.url = url
|
||||||
self.path = path
|
self.path = path
|
||||||
self.refspec = refspec
|
self.refspec = refspec
|
||||||
self.sublayers = sublayers
|
self._layers = layers
|
||||||
self.name = os.path.basename(self.path)
|
self.name = os.path.basename(self.path)
|
||||||
self.git_operation_disabled = False
|
self.git_operation_disabled = False
|
||||||
|
|
||||||
@ -51,10 +51,10 @@ class Repo:
|
|||||||
|
|
||||||
def __getattr__(self, item):
|
def __getattr__(self, item):
|
||||||
if item == 'layers':
|
if item == 'layers':
|
||||||
if not self.sublayers:
|
if not self._layers:
|
||||||
return [self.path]
|
return [self.path]
|
||||||
else:
|
else:
|
||||||
return [self.path + '/' + l for l in self.sublayers]
|
return [self.path + '/' + l for l 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}'
|
||||||
@ -65,4 +65,5 @@ class Repo:
|
|||||||
.replace('*', '.'))
|
.replace('*', '.'))
|
||||||
|
|
||||||
def __str__(self):
|
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