repos: introduce a new repo conf parameter "type"

This will be used to carry the type of repo we are talking about. At the
moment it defaults to "git".

Signed-off-by: Henning Schild <henning.schild@siemens.com>
This commit is contained in:
Henning Schild 2018-01-05 16:00:28 +01:00 committed by Daniel Wagner
parent 9da82dba13
commit 0c7db599fd
5 changed files with 21 additions and 5 deletions

View File

@ -57,3 +57,12 @@ Added
- ``env`` key now allows to pass custom environment variables to the bitbake
build process.
Version 7
---------
Added
~~~~~
- ``type`` property to ``repos`` to be able to express which version control
system to use.

View File

@ -28,5 +28,5 @@ __copyright__ = 'Copyright (c) Siemens AG, 2017'
__version__ = '0.15.0'
# Please update docs/format-changelog.rst when changing the file version.
__file_version__ = 6
__file_version__ = 7
__compatible_file_version__ = 1

View File

@ -187,6 +187,7 @@ class Config:
layers_dict))
url = repo_config_dict[repo].get('url', None)
name = repo_config_dict[repo].get('name', repo)
typ = repo_config_dict[repo].get('type', 'git')
refspec = repo_config_dict[repo].get('refspec', None)
path = repo_config_dict[repo].get('path', None)
dis_ops = False
@ -204,8 +205,9 @@ class Config:
else:
path = path or os.path.join(self.kas_work_dir, name)
rep = Repo.factory(url=url, path=path, refspec=refspec,
layers=layers, disable_operations=dis_ops)
rep = Repo.factory(url=url, path=path, typ=typ,
refspec=refspec, layers=layers,
disable_operations=dis_ops)
repo_dict[repo] = rep
return repo_dict

View File

@ -114,6 +114,9 @@ CONFIGSCHEMA = {
'url': {
'type': 'string',
},
'type': {
'type': 'string',
},
'refspec': {
'type': 'string',
},

View File

@ -69,12 +69,14 @@ class Repo:
self.path, self._layers)
@staticmethod
def factory(url, path, refspec, layers, disable_operations):
def factory(url, path, typ, refspec, layers, disable_operations):
"""
Return an instance Repo depending on params.
"""
# pylint: disable=too-many-arguments
return GitRepo(url, path, refspec, layers, disable_operations)
if typ == 'git':
return GitRepo(url, path, refspec, layers, disable_operations)
raise NotImplementedError('Repo typ "%s" not supported.' % typ)
@staticmethod
def get_root_path(path, environ):