Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 859A5E00C2B; Thu, 17 Mar 2016 11:27:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [74.125.82.41 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 8E576E00931 for ; Thu, 17 Mar 2016 11:27:44 -0700 (PDT) Received: by mail-wm0-f41.google.com with SMTP id p65so6159481wmp.0 for ; Thu, 17 Mar 2016 11:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UvBPM3h5RMWFyu+Eux7HXAralArVPNDxXnZhF0F1Ink=; b=ov7aHUXa6PoJSjyErwWKHs0HBcZ5aSfRqNKIa+mPTbHqQ0dzzwszhFJ14YYLMMJ17A 6Tj7tQQhPJCCqby8jW0g8Mq6stgI5CiUIC2qxgczHx4fdEjFQF+Qjh10esngaVBnQB03 iR0ei/4OUGFJ2YF2+4s4+536cqtkKMhPZMfka61nFUUscoApIxuGCD26Ny4rdtNWq/fr tGgruSq72S012XltwLqyMgacFRli6uSc4k20COhL1Kacwm4rHAO2o1ZBjhxXXsR9ck4x K7sXaZFOHDtf98hbmDyJIxPodAcC0Ms0svndtWdFW5UtPbLNHklXXyGEm6uU2JNoxyKv Y6hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UvBPM3h5RMWFyu+Eux7HXAralArVPNDxXnZhF0F1Ink=; b=YGS0LP8Z5BUhMiQ27eJxkBYuNGpfSeOEHYeQ3PQKb7aNWdZQqqVEgm0NE38zz7Fy/q vSigwb0VMQTiwSbVWtMU7GJt9pVYfkITpxELKCg4rhVKikw3saX5p4xLy7qJCTG6E6Z1 SZzxSQyIs5mHNMBqxARF7H/zkvxqW4ziU8KqKDiFbAadeyfip+KHi2A9Fci/ncaLDYOC z7Tv1lYHC0kqXNHo9unJfgjLEvJ0Woi4Bb9TXa2eZZ4ZnbZk8KdS1pr1nh9Ap26aMXyl YpSpi21+drcYHPZ2j3RQ3pmMnwlj4qyReLcy/n8nr1xQdeMsmrU1MeiY/leeXIXg6cNn hheg== X-Gm-Message-State: AD7BkJIhzP0aHOvJop1DJpcYm2INa5cwS+T3I66qnSVeeLW1t0pWxyncG1TvnmOslEYtRWAd X-Received: by 10.194.58.169 with SMTP id s9mr11715015wjq.52.1458239263311; Thu, 17 Mar 2016 11:27:43 -0700 (PDT) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id 198sm9276525wml.22.2016.03.17.11.27.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 11:27:42 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 17 Mar 2016 18:27:02 +0000 Message-Id: <1458239222-12383-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457620109-9496-2-git-send-email-michael.g.wood@intel.com> References: <1457620109-9496-2-git-send-email-michael.g.wood@intel.com> Subject: [v2 PATCH] toaster: buildinfohelper Add additional metadata to the built layer X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 18:27:46 -0000 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 --- 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 28c7353..80ac800 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']: -- 2.1.4