Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 4C3A2E00C44; Mon, 21 Mar 2016 07:58:12 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high * trust * [192.55.52.93 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 758FEE00ACF for ; Mon, 21 Mar 2016 07:58:08 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 21 Mar 2016 07:58:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,372,1455004800"; d="scan'208";a="768285589" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by orsmga003.jf.intel.com with ESMTP; 21 Mar 2016 07:58:07 -0700 Received: from irsmsx110.ger.corp.intel.com ([169.254.15.10]) by IRSMSX101.ger.corp.intel.com ([169.254.1.157]) with mapi id 14.03.0248.002; Mon, 21 Mar 2016 14:58:06 +0000 From: "Barros Pena, Belen" To: "Wood, Michael G" , "toaster@yoctoproject.org" Thread-Topic: [Toaster] [v2 PATCH] toaster: buildinfohelper Add additional metadata to the built layer Thread-Index: AQHRg4ISjVHWzD6ymE2avg70PZJZlw== Date: Mon, 21 Mar 2016 14:58:05 +0000 Message-ID: References: <1457620109-9496-2-git-send-email-michael.g.wood@intel.com> <1458239222-12383-1-git-send-email-michael.g.wood@intel.com> In-Reply-To: <1458239222-12383-1-git-send-email-michael.g.wood@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.6.2.160219 x-originating-ip: [10.237.224.41] MIME-Version: 1.0 Subject: Re: [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: Mon, 21 Mar 2016 14:58:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable On 17/03/2016 18:27, "toaster-bounces@yoctoproject.org on behalf of Michael Wood" 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] This totally works: * Images now come up in the image recipes page of local projects after you build them * The build information includes the layer branch But it prompts the question of why we are seeing different branches for the core layers: meta-poky and meta-yocto-bsp show master, but my openembedded-core shows a different brach (a development one I was using previously). I know this has nothing to do with this patch, but just wondering why this is happening, and whether is a toaster thing or a bitbake thing. Thanks! Bel=E9n =20 > >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): >=20 > # create a new copy of this layer version as a snapshot for > # historical purposes >- layer_copy, c =3D >Layer_Version.objects.get_or_create(build=3Dbuild_obj, >- layer=3Dlayer_obj.layer, >- commit=3Dlayer_version_information['commit'], >- local_path =3D >layer_version_information['local_path'], >- ) >- logger.info("created new historical layer version %d", >layer_copy.pk) >+ layer_copy, c =3D Layer_Version.objects.get_or_create( >+ build=3Dbuild_obj, >+ layer=3Dlayer_obj.layer, >+ up_branch=3Dlayer_obj.up_branch, >+ branch=3Dlayer_version_information['branch'], >+ commit=3Dlayer_version_information['commit'], >+ local_path=3Dlayer_version_information['local_path'], >+ ) >+ >+ logger.info("created new historical layer version %d", >+ layer_copy.pk) >=20 > self.layer_version_built.append(layer_copy) >=20 >@@ -581,11 +586,15 @@ class ORMWrapper(object): > =20 >packagedict[p]['object'].package_dependencies_target.all().delete() > =20 >packagedict[p]['object'].package_dependencies_source.all().delete() > try: >- recipe =3D self._cached_get(Recipe, >- name=3Dbuilt_recipe.name, >- layer_version__build=3DNone= , >- =20 >file_path=3Dbuilt_recipe.file_path, >- =20 >version=3Dbuilt_recipe.version) >+ recipe =3D self._cached_get( >+ Recipe, >+ name=3Dbuilt_recipe.name, >+ layer_version__build=3DNone, >+ layer_version__up_branch=3D >+ built_recipe.layer_version.up_branch, >+ file_path=3Dbuilt_recipe.file_path, >+ version=3Dbuilt_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 =3D True >+ recipe_info['is_image'] =3D True >+ # Save the is_image state to the relevant recipe >objects >+ =20 >self.orm_wrapper.get_update_recipe_object(recipe_info) > break > if recipe.is_image: > for t in self.internal_state['targets']: >--=20 >2.1.4 > >--=20 >_______________________________________________ >toaster mailing list >toaster@yoctoproject.org >https://lists.yoctoproject.org/listinfo/toaster