bitbake: toaster: buildinfohelper Add handling local layers (i.e. non-git) layers
Adds handling of the non-git layers to create and update the corresponding layer objects in Toaster. (Bitbake rev: 0a9b5d7d9655dbb09d458fc6e330e932f0f9dab6) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
4ac57fb73e
commit
e274a5167e
|
@ -419,13 +419,24 @@ class ORMWrapper(object):
|
||||||
assert 'name' in layer_information
|
assert 'name' in layer_information
|
||||||
assert 'layer_index_url' in layer_information
|
assert 'layer_index_url' in layer_information
|
||||||
|
|
||||||
|
# From command line builds we have no brbe as the request is directly
|
||||||
|
# from bitbake
|
||||||
if brbe is None:
|
if brbe is None:
|
||||||
layer_object, _ = Layer.objects.get_or_create(
|
# If we don't have git commit sha then we're using a non-git
|
||||||
|
# layer so set the layer_source_dir to identify it as such
|
||||||
|
if not layer_information['version']['commit']:
|
||||||
|
local_source_dir = layer_information["local_path"]
|
||||||
|
else:
|
||||||
|
local_source_dir = None
|
||||||
|
|
||||||
|
layer_object, _ = \
|
||||||
|
Layer.objects.get_or_create(
|
||||||
name=layer_information['name'],
|
name=layer_information['name'],
|
||||||
|
local_source_dir=local_source_dir,
|
||||||
layer_index_url=layer_information['layer_index_url'])
|
layer_index_url=layer_information['layer_index_url'])
|
||||||
|
|
||||||
return layer_object
|
return layer_object
|
||||||
else:
|
else:
|
||||||
# we are under managed mode; we must match the layer used in the Project Layer
|
|
||||||
br_id, be_id = brbe.split(":")
|
br_id, be_id = brbe.split(":")
|
||||||
|
|
||||||
# find layer by checkout path;
|
# find layer by checkout path;
|
||||||
|
@ -450,6 +461,11 @@ class ORMWrapper(object):
|
||||||
if brl.layer_version:
|
if brl.layer_version:
|
||||||
return brl.layer_version
|
return brl.layer_version
|
||||||
|
|
||||||
|
# This might be a local layer (i.e. no git info) so try
|
||||||
|
# matching local_source_dir
|
||||||
|
if brl.local_source_dir and brl.local_source_dir == layer_information["local_path"]:
|
||||||
|
return brl.layer_version
|
||||||
|
|
||||||
# we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
|
# we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
|
||||||
#logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
|
#logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
|
||||||
|
|
||||||
|
@ -974,6 +990,9 @@ class BuildInfoHelper(object):
|
||||||
# we can match to the recipe file path
|
# we can match to the recipe file path
|
||||||
if path.startswith(lvo.local_path):
|
if path.startswith(lvo.local_path):
|
||||||
return lvo
|
return lvo
|
||||||
|
if lvo.layer.local_source_dir and \
|
||||||
|
path.startswith(lvo.layer.local_source_dir):
|
||||||
|
return lvo
|
||||||
|
|
||||||
#if we get here, we didn't read layers correctly; dump whatever information we have on the error log
|
#if we get here, we didn't read layers correctly; dump whatever information we have on the error log
|
||||||
logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
|
logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
|
||||||
|
|
Loading…
Reference in New Issue