All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Wood <michael.g.wood@intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH] toaster: buildinfohelper Add additional metadata to the built layer
Date: Thu, 10 Mar 2016 11:27:30 +0000	[thread overview]
Message-ID: <56E15A22.2000003@intel.com> (raw)
In-Reply-To: <1457548997-14685-1-git-send-email-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>
---
  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



       reply	other threads:[~2016-03-10 11:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1457548997-14685-1-git-send-email-michael.g.wood@intel.com>
2016-03-10 11:27 ` Michael Wood [this message]
2016-04-01 11:58   ` [PATCH] toaster: buildinfohelper Add additional metadata to the built layer Smith, Elliot
2016-04-01 11:53 Elliot Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E15A22.2000003@intel.com \
    --to=michael.g.wood@intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.