summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-08-09 13:50:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-11 00:09:30 +0100
commite274a5167ea2e495355bd1382b1388d047b845d7 (patch)
tree59888814a89f1f3f19dae1d77b0fa97aa26ab8c6
parent4ac57fb73e623048756c572b93d12893a5a67414 (diff)
downloadpoky-e274a5167ea2e495355bd1382b1388d047b845d7.tar.gz
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>
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py27
1 files changed, 23 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 5044324628..7a16ec6aab 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -419,13 +419,24 @@ class ORMWrapper(object):
419 assert 'name' in layer_information 419 assert 'name' in layer_information
420 assert 'layer_index_url' in layer_information 420 assert 'layer_index_url' in layer_information
421 421
422 # From command line builds we have no brbe as the request is directly
423 # from bitbake
422 if brbe is None: 424 if brbe is None:
423 layer_object, _ = Layer.objects.get_or_create( 425 # If we don't have git commit sha then we're using a non-git
424 name=layer_information['name'], 426 # layer so set the layer_source_dir to identify it as such
425 layer_index_url=layer_information['layer_index_url']) 427 if not layer_information['version']['commit']:
428 local_source_dir = layer_information["local_path"]
429 else:
430 local_source_dir = None
431
432 layer_object, _ = \
433 Layer.objects.get_or_create(
434 name=layer_information['name'],
435 local_source_dir=local_source_dir,
436 layer_index_url=layer_information['layer_index_url'])
437
426 return layer_object 438 return layer_object
427 else: 439 else:
428 # we are under managed mode; we must match the layer used in the Project Layer
429 br_id, be_id = brbe.split(":") 440 br_id, be_id = brbe.split(":")
430 441
431 # find layer by checkout path; 442 # find layer by checkout path;
@@ -450,6 +461,11 @@ class ORMWrapper(object):
450 if brl.layer_version: 461 if brl.layer_version:
451 return brl.layer_version 462 return brl.layer_version
452 463
464 # This might be a local layer (i.e. no git info) so try
465 # matching local_source_dir
466 if brl.local_source_dir and brl.local_source_dir == layer_information["local_path"]:
467 return brl.layer_version
468
453 # we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build() 469 # we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
454 #logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname)) 470 #logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
455 471
@@ -974,6 +990,9 @@ class BuildInfoHelper(object):
974 # we can match to the recipe file path 990 # we can match to the recipe file path
975 if path.startswith(lvo.local_path): 991 if path.startswith(lvo.local_path):
976 return lvo 992 return lvo
993 if lvo.layer.local_source_dir and \
994 path.startswith(lvo.layer.local_source_dir):
995 return lvo
977 996
978 #if we get here, we didn't read layers correctly; dump whatever information we have on the error log 997 #if we get here, we didn't read layers correctly; dump whatever information we have on the error log
979 logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects) 998 logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)