Patchwork [3/3] dbus: fix ptest issue

login
register
mail settings
Submitter Chong.Lu@windriver.com
Date Aug. 5, 2014, 8:33 a.m.
Message ID <da89178aaf28354f57e6b83df496838aebb13ab6.1407227521.git.Chong.Lu@windriver.com>
Download mbox | patch
Permalink /patch/77281/
State New
Headers show

Comments

Chong.Lu@windriver.com - Aug. 5, 2014, 8:33 a.m.
We use PTEST_ENABLED to decide whether build ptest package, so inherit
ptest.bbclass in dbus.inc in order to using PTEST_ENABLED variable.
Remove PACKAGES and ALLOW_EMPTY, since they have been defined in ptest.bbclass.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 meta/recipes-core/dbus/dbus.inc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Richard Purdie - Aug. 5, 2014, 9:53 a.m.
On Tue, 2014-08-05 at 16:33 +0800, Chong Lu wrote:
> We use PTEST_ENABLED to decide whether build ptest package, so inherit
> ptest.bbclass in dbus.inc in order to using PTEST_ENABLED variable.
> Remove PACKAGES and ALLOW_EMPTY, since they have been defined in ptest.bbclass.
> 
> Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
> ---
>  meta/recipes-core/dbus/dbus.inc | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
> index d38ba7e..6268103 100644
> --- a/meta/recipes-core/dbus/dbus.inc
> +++ b/meta/recipes-core/dbus/dbus.inc
> @@ -8,10 +8,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
>  DEPENDS = "expat virtual/libintl"
>  RDEPENDS_dbus_class-native = ""
>  RDEPENDS_dbus_class-nativesdk = ""
> -PACKAGES += "${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus-ptest', '', d)}"
> -ALLOW_EMPTY_dbus-ptest = "1"


I don't think you've understood what this is doing, its conditionally
building the separate dbus-ptest recipe, if ptest is enabled.

Why is it separate? dbus-ptest needs glib and glib needs dbus. Your
patch doesn't seem to account for any of that.

"fix ptest issue" is far too vague as a summary of this patch too.

Cheers,

Richard
Chong.Lu@windriver.com - Aug. 5, 2014, 10:07 a.m.
On 08/05/2014 05:53 PM, Richard Purdie wrote:
> On Tue, 2014-08-05 at 16:33 +0800, Chong Lu wrote:
>> We use PTEST_ENABLED to decide whether build ptest package, so inherit
>> ptest.bbclass in dbus.inc in order to using PTEST_ENABLED variable.
>> Remove PACKAGES and ALLOW_EMPTY, since they have been defined in ptest.bbclass.
>>
>> Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
>> ---
>>   meta/recipes-core/dbus/dbus.inc | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
>> index d38ba7e..6268103 100644
>> --- a/meta/recipes-core/dbus/dbus.inc
>> +++ b/meta/recipes-core/dbus/dbus.inc
>> @@ -8,10 +8,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
>>   DEPENDS = "expat virtual/libintl"
>>   RDEPENDS_dbus_class-native = ""
>>   RDEPENDS_dbus_class-nativesdk = ""
>> -PACKAGES += "${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus-ptest', '', d)}"
>> -ALLOW_EMPTY_dbus-ptest = "1"
>
> I don't think you've understood what this is doing, its conditionally
> building the separate dbus-ptest recipe, if ptest is enabled.
>
> Why is it separate? dbus-ptest needs glib and glib needs dbus. Your
> patch doesn't seem to account for any of that.
>
> "fix ptest issue" is far too vague as a summary of this patch too.
>
> Cheers,
>
> Richard
>
>
>
Hi Richard,

Previously, we use DISTRO_FEATURES to decide whether build ptest, but we 
use PTEST_ENABLED now.
PTEST_ENABLED defined in ptest.bbclass. we did't inherit ptest in dbus 
recipes, this cause we can't build dbus-ptest package.
Based on above reason, I just send this patch to fix this issue. Or do 
you have a better way?

Best Regards
Chong
Paul Eggleton - Aug. 5, 2014, 10:16 a.m.
On Tuesday 05 August 2014 18:07:50 Chong Lu wrote:
> On 08/05/2014 05:53 PM, Richard Purdie wrote:
> > On Tue, 2014-08-05 at 16:33 +0800, Chong Lu wrote:
> >> We use PTEST_ENABLED to decide whether build ptest package, so inherit
> >> ptest.bbclass in dbus.inc in order to using PTEST_ENABLED variable.
> >> Remove PACKAGES and ALLOW_EMPTY, since they have been defined in
> >> ptest.bbclass.
> >> 
> >> Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
> >> ---
> >> 
> >>   meta/recipes-core/dbus/dbus.inc | 7 +++++--
> >>   1 file changed, 5 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/meta/recipes-core/dbus/dbus.inc
> >> b/meta/recipes-core/dbus/dbus.inc index d38ba7e..6268103 100644
> >> --- a/meta/recipes-core/dbus/dbus.inc
> >> +++ b/meta/recipes-core/dbus/dbus.inc
> >> @@ -8,10 +8,13 @@ LIC_FILES_CHKSUM =
> >> "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \>> 
> >>   DEPENDS = "expat virtual/libintl"
> >>   RDEPENDS_dbus_class-native = ""
> >>   RDEPENDS_dbus_class-nativesdk = ""
> >> 
> >> -PACKAGES += "${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus-ptest',
> >> '', d)}" -ALLOW_EMPTY_dbus-ptest = "1"
> > 
> > I don't think you've understood what this is doing, its conditionally
> > building the separate dbus-ptest recipe, if ptest is enabled.
> > 
> > Why is it separate? dbus-ptest needs glib and glib needs dbus. Your
> > patch doesn't seem to account for any of that.
> > 
> > "fix ptest issue" is far too vague as a summary of this patch too.
> > 
> > Cheers,
> > 
> > Richard
> 
> Hi Richard,
> 
> Previously, we use DISTRO_FEATURES to decide whether build ptest, but we
> use PTEST_ENABLED now.
> PTEST_ENABLED defined in ptest.bbclass. we did't inherit ptest in dbus
> recipes, this cause we can't build dbus-ptest package.
> Based on above reason, I just send this patch to fix this issue. Or do
> you have a better way?

If you mean that you're setting PTEST_ENABLED globally, you shouldn't be doing 
that. PTEST_ENABLED is supposed to be used for recipes to *detect* whether 
ptest should be enabled, so that e.g. we can disable it for the native class.

Cheers,
Paul

Patch

diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index d38ba7e..6268103 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -8,10 +8,13 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
 DEPENDS = "expat virtual/libintl"
 RDEPENDS_dbus_class-native = ""
 RDEPENDS_dbus_class-nativesdk = ""
-PACKAGES += "${@bb.utils.contains('PTEST_ENABLED', '1', 'dbus-ptest', '', d)}"
-ALLOW_EMPTY_dbus-ptest = "1"
+inherit ptest
 RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
 
+do_install_ptest_base() {
+	rm -rf ${D}${PTEST_PATH}
+}
+
 SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
            file://tmpdir.patch \
            file://dbus-1.init \