* [PATCH] toaster: buildinfohelper Add additional metadata to the built layer
[not found] <1457548997-14685-1-git-send-email-michael.g.wood@intel.com>
@ 2016-03-10 11:27 ` Michael Wood
2016-04-01 11:58 ` Smith, Elliot
0 siblings, 1 reply; 3+ messages in thread
From: Michael Wood @ 2016-03-10 11:27 UTC (permalink / raw)
To: toaster
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]
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
bitbake/lib/bb/ui/buildinfohelper.py | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
b/bitbake/lib/bb/ui/buildinfohelper.py
index 7fedb76..2dba00a 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -358,12 +358,17 @@ class ORMWrapper(object):
# create a new copy of this layer version as a snapshot for
# historical purposes
- layer_copy, c =
Layer_Version.objects.get_or_create(build=build_obj,
- layer=layer_obj.layer,
- commit=layer_version_information['commit'],
- local_path =
layer_version_information['local_path'],
- )
- logger.info("created new historical layer version %d",
layer_copy.pk)
+ layer_copy, c = Layer_Version.objects.get_or_create(
+ build=build_obj,
+ layer=layer_obj.layer,
+ up_branch=layer_obj.up_branch,
+ branch=layer_version_information['branch'],
+ commit=layer_version_information['commit'],
+ local_path=layer_version_information['local_path'],
+ )
+
+ logger.info("created new historical layer version %d",
+ layer_copy.pk)
self.layer_version_built.append(layer_copy)
@@ -584,11 +589,15 @@ class ORMWrapper(object):
packagedict[p]['object'].package_dependencies_target.all().delete()
packagedict[p]['object'].package_dependencies_source.all().delete()
try:
- recipe = self._cached_get(Recipe,
- name=built_recipe.name,
- layer_version__build=None,
-
file_path=built_recipe.file_path,
- version=built_recipe.version)
+ recipe = self._cached_get(
+ Recipe,
+ name=built_recipe.name,
+ layer_version__build=None,
+ layer_version__up_branch=
+ built_recipe.layer_version.up_branch,
+ file_path=built_recipe.file_path,
+ version=built_recipe.version
+ )
except (Recipe.DoesNotExist,
Recipe.MultipleObjectsReturned) as e:
logger.info("We did not find one recipe for the"
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] toaster: buildinfohelper Add additional metadata to the built layer
@ 2016-04-01 11:53 Elliot Smith
0 siblings, 0 replies; 3+ messages in thread
From: Elliot Smith @ 2016-04-01 11:53 UTC (permalink / raw)
To: bitbake-devel
From: Michael Wood <michael.g.wood@intel.com>
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]
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/bb/ui/buildinfohelper.py | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 7b8b1a5..5a33d53 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -355,12 +355,17 @@ class ORMWrapper(object):
# create a new copy of this layer version as a snapshot for
# historical purposes
- layer_copy, c = Layer_Version.objects.get_or_create(build=build_obj,
- layer=layer_obj.layer,
- commit=layer_version_information['commit'],
- local_path = layer_version_information['local_path'],
- )
- logger.info("created new historical layer version %d", layer_copy.pk)
+ layer_copy, c = Layer_Version.objects.get_or_create(
+ build=build_obj,
+ layer=layer_obj.layer,
+ up_branch=layer_obj.up_branch,
+ branch=layer_version_information['branch'],
+ commit=layer_version_information['commit'],
+ local_path=layer_version_information['local_path'],
+ )
+
+ logger.info("created new historical layer version %d",
+ layer_copy.pk)
self.layer_version_built.append(layer_copy)
@@ -581,11 +586,15 @@ class ORMWrapper(object):
packagedict[p]['object'].package_dependencies_target.all().delete()
packagedict[p]['object'].package_dependencies_source.all().delete()
try:
- recipe = self._cached_get(Recipe,
- name=built_recipe.name,
- layer_version__build=None,
- file_path=built_recipe.file_path,
- version=built_recipe.version)
+ recipe = self._cached_get(
+ Recipe,
+ name=built_recipe.name,
+ layer_version__build=None,
+ layer_version__up_branch=
+ built_recipe.layer_version.up_branch,
+ file_path=built_recipe.file_path,
+ version=built_recipe.version
+ )
except (Recipe.DoesNotExist,
Recipe.MultipleObjectsReturned) as e:
logger.info("We did not find one recipe for the"
@@ -1293,6 +1302,9 @@ class BuildInfoHelper(object):
for cls in event._depgraph['pn'][pn]['inherits']:
if cls.endswith('/image.bbclass'):
recipe.is_image = True
+ recipe_info['is_image'] = True
+ # Save the is_image state to the relevant recipe objects
+ self.orm_wrapper.get_update_recipe_object(recipe_info)
break
if recipe.is_image:
for t in self.internal_state['targets']:
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] toaster: buildinfohelper Add additional metadata to the built layer
2016-03-10 11:27 ` [PATCH] toaster: buildinfohelper Add additional metadata to the built layer Michael Wood
@ 2016-04-01 11:58 ` Smith, Elliot
0 siblings, 0 replies; 3+ messages in thread
From: Smith, Elliot @ 2016-04-01 11:58 UTC (permalink / raw)
To: Michael Wood; +Cc: toaster
[-- Attachment #1: Type: text/plain, Size: 3546 bytes --]
Sent upstream to bitbake-devel and added to toaster-next.
Elliot
On 10 March 2016 at 11:27, Michael Wood <michael.g.wood@intel.com> wrote:
> 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]
>
> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
> ---
> bitbake/lib/bb/ui/buildinfohelper.py | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> b/bitbake/lib/bb/ui/buildinfohelper.py
> index 7fedb76..2dba00a 100644
> --- a/bitbake/lib/bb/ui/buildinfohelper.py
> +++ b/bitbake/lib/bb/ui/buildinfohelper.py
> @@ -358,12 +358,17 @@ class ORMWrapper(object):
> # create a new copy of this layer version as a snapshot for
> # historical purposes
> - layer_copy, c =
> Layer_Version.objects.get_or_create(build=build_obj,
> - layer=layer_obj.layer,
> - commit=layer_version_information['commit'],
> - local_path =
> layer_version_information['local_path'],
> - )
> - logger.info("created new historical layer version %d",
> layer_copy.pk)
> + layer_copy, c = Layer_Version.objects.get_or_create(
> + build=build_obj,
> + layer=layer_obj.layer,
> + up_branch=layer_obj.up_branch,
> + branch=layer_version_information['branch'],
> + commit=layer_version_information['commit'],
> + local_path=layer_version_information['local_path'],
> + )
> +
> + logger.info("created new historical layer version %d",
> + layer_copy.pk)
> self.layer_version_built.append(layer_copy)
> @@ -584,11 +589,15 @@ class ORMWrapper(object):
>
> packagedict[p]['object'].package_dependencies_target.all().delete()
>
> packagedict[p]['object'].package_dependencies_source.all().delete()
> try:
> - recipe = self._cached_get(Recipe,
> - name=built_recipe.name,
> - layer_version__build=None,
> - file_path=built_recipe.file_path,
> -
> version=built_recipe.version)
> + recipe = self._cached_get(
> + Recipe,
> + name=built_recipe.name,
> + layer_version__build=None,
> + layer_version__up_branch=
> + built_recipe.layer_version.up_branch,
> + file_path=built_recipe.file_path,
> + version=built_recipe.version
> + )
> except (Recipe.DoesNotExist,
> Recipe.MultipleObjectsReturned) as e:
> logger.info("We did not find one recipe for the"
> --
> 1.9.1
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
[-- Attachment #2: Type: text/html, Size: 5385 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-01 11:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1457548997-14685-1-git-send-email-michael.g.wood@intel.com>
2016-03-10 11:27 ` [PATCH] toaster: buildinfohelper Add additional metadata to the built layer Michael Wood
2016-04-01 11:58 ` Smith, Elliot
2016-04-01 11:53 Elliot Smith
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.