summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-04-01 12:53:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-03 15:53:43 +0100
commitc9ad1e6703337b7fa405d615af5af69113306971 (patch)
tree65d905560047f1fcb8c72c48e3ff6ccb75ff3a1c /bitbake
parent072a0b3e872aeb32ee3470b72a72c8167f420aa4 (diff)
downloadpoky-c9ad1e6703337b7fa405d615af5af69113306971.tar.gz
bitbake: toaster: buildinfohelper Add additional metadata to the built layer
Add additional metadata to the layer created for build history to be able to identify the layer and recipe later on. Specifically this is the branch and release to which the recipe and layer are associated with enabling differentiation of two recipes which are local release and master and 'master' release. [YOCTO #8528] [YOCTO #8545] (Bitbake rev: 3deebd887bddbbd02fd9829a180aab494b1af7c4) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py34
1 files changed, 23 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index bddce4f4b7..ed43f4c10d 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -358,12 +358,17 @@ class ORMWrapper(object):
358 358
359 # create a new copy of this layer version as a snapshot for 359 # create a new copy of this layer version as a snapshot for
360 # historical purposes 360 # historical purposes
361 layer_copy, c = Layer_Version.objects.get_or_create(build=build_obj, 361 layer_copy, c = Layer_Version.objects.get_or_create(
362 layer=layer_obj.layer, 362 build=build_obj,
363 commit=layer_version_information['commit'], 363 layer=layer_obj.layer,
364 local_path = layer_version_information['local_path'], 364 up_branch=layer_obj.up_branch,
365 ) 365 branch=layer_version_information['branch'],
366 logger.info("created new historical layer version %d", layer_copy.pk) 366 commit=layer_version_information['commit'],
367 local_path=layer_version_information['local_path'],
368 )
369
370 logger.info("created new historical layer version %d",
371 layer_copy.pk)
367 372
368 self.layer_version_built.append(layer_copy) 373 self.layer_version_built.append(layer_copy)
369 374
@@ -584,11 +589,15 @@ class ORMWrapper(object):
584 packagedict[p]['object'].package_dependencies_target.all().delete() 589 packagedict[p]['object'].package_dependencies_target.all().delete()
585 packagedict[p]['object'].package_dependencies_source.all().delete() 590 packagedict[p]['object'].package_dependencies_source.all().delete()
586 try: 591 try:
587 recipe = self._cached_get(Recipe, 592 recipe = self._cached_get(
588 name=built_recipe.name, 593 Recipe,
589 layer_version__build=None, 594 name=built_recipe.name,
590 file_path=built_recipe.file_path, 595 layer_version__build=None,
591 version=built_recipe.version) 596 layer_version__up_branch=
597 built_recipe.layer_version.up_branch,
598 file_path=built_recipe.file_path,
599 version=built_recipe.version
600 )
592 except (Recipe.DoesNotExist, 601 except (Recipe.DoesNotExist,
593 Recipe.MultipleObjectsReturned) as e: 602 Recipe.MultipleObjectsReturned) as e:
594 logger.info("We did not find one recipe for the" 603 logger.info("We did not find one recipe for the"
@@ -1297,6 +1306,9 @@ class BuildInfoHelper(object):
1297 for cls in event._depgraph['pn'][pn]['inherits']: 1306 for cls in event._depgraph['pn'][pn]['inherits']:
1298 if cls.endswith('/image.bbclass'): 1307 if cls.endswith('/image.bbclass'):
1299 recipe.is_image = True 1308 recipe.is_image = True
1309 recipe_info['is_image'] = True
1310 # Save the is_image state to the relevant recipe objects
1311 self.orm_wrapper.get_update_recipe_object(recipe_info)
1300 break 1312 break
1301 if recipe.is_image: 1313 if recipe.is_image:
1302 for t in self.internal_state['targets']: 1314 for t in self.internal_state['targets']: