From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 3D85AE00C9A; Mon, 25 Apr 2016 00:00:28 -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,HTML_MESSAGE, 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 * [134.134.136.20 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 113EBE00C72 for ; Mon, 25 Apr 2016 00:00:23 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 25 Apr 2016 00:00:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,531,1455004800"; d="scan'208,217";a="91280890" Received: from avalluri-gigabyte.fi.intel.com (HELO [10.237.72.170]) ([10.237.72.170]) by fmsmga004.fm.intel.com with ESMTP; 25 Apr 2016 00:00:21 -0700 To: "yocto@yoctoproject.org" References: From: Amarnath Valluri Message-ID: <571DC147.9040001@intel.com> Date: Mon, 25 Apr 2016 10:03:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: Enable a recipe/package only when other dependent recipe/package is part of image. X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 07:00:28 -0000 Content-Type: multipart/alternative; boundary="------------050103060102080406070906" --------------050103060102080406070906 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable On Friday 22 April 2016 02:09 PM, Valluri, Amarnath wrote: > > Hello, > > I have my own layer, that provides configuration packages for core = > Linux components, for example =91connman-conf=92 for =91connman=92 packag= e. > > I would like to provide a pakcagegroup-config, that should = > automatically select the configuration packages that are part of image = > configuration. Say if =91connman=92 is part of image then it should add = > =91connman-conf=92 to its RDEPENDS_${PN}. > > For this I try to use =91oe.packagedata.pkgmap=92, to check if the core = > component exists as below: > > -------------------------------------------------------------------- > > def check_if_enabled(comp, trueval, d): > > import oe.packagedata > > pkgmap =3D oe.packagedata.pkgmap(d) > > if pkgmap is not None and pkgmap.get(comp) is not None: > > return trueval > > return =93=94 > > RDEPENDS_${PN} =3D =93 \ > > ${@check_if_enabled(=93connman=94, =93connman-conf=94, d)} \ > > =93 > > ----------------------------------------------------------- > > This works as expected when the packagedata is available, i.e., image = > is build at least once first, then my layer is added to BBLAYERS and = > then rebuild the image. > > But this fails when there is no packagedata cache available. > > Can someone help me to resolve this properly. > > Thanks, > > Amarnath > --------------------------------------------------------------------- Intel Finland Oy Registered Address: PL 281, 00181 Helsinki = Business Identity Code: 0357606 - 4 = Domiciled in Helsinki = 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. --------------050103060102080406070906 MIME-Version: 1.0 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: quoted-printable

On Friday 22 April 2016 02:09 PM, Valluri, Amarnath wrote:

Hello,

=A0

I have my own layer, that provides configuration packages for core Linux components, for example =91connman-conf=92 for =91connman=92 package.

=A0

I would like to provide a pakcagegroup-config, that should automatically select the configuration packages that are part of image configuration. Say if =91connman=92 is part of image then it should add =91connman-conf=92 to its RDEPENDS_${PN}.=A0 =

=A0

For this I try to use =91oe.packagedata.pkgmap=92, to check if the core component exists as below:

-----------------------= ---------------------------------------------

def check_if_enabled(comp, trueval, d):

=A0=A0 import oe.packag= edata

=A0=A0 pkgmap =3D oe.packagedata.pkgmap(d)

=A0

=A0 =A0if pkgmap is not= None and pkgmap.get(comp) is not None:

=A0=A0=A0=A0 =A0return = trueval

=A0

=A0 =A0return =93=94

=A0

RDEPENDS_${PN} =3D =93 = \

=A0=A0 ${@check_if_enabled(=93connman=94, =93connman-conf=94, d)} \

=93

-----------------------= ------------------------------------

=A0

This works as expected when the packagedata is available, i.e., image is build at least once first, then my layer is added to BBLAYERS and then rebuild the image.

But this fails when there is no packagedata cache available.

=A0

Can someone help me to resolve this properly.

=A0

Thanks,

Amarnath


---------------------------------------------------------------------<= br> Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

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.

--------------050103060102080406070906--