Patchwork [1/1] dbus: fix a hard dependency about dbus-ptest

login
register
mail settings
Submitter Chong.Lu@windriver.com
Date March 6, 2014, 8:06 a.m.
Message ID <9477177f82743adfab34256b7bc002a37dd61787.1394093112.git.Chong.Lu@windriver.com>
Download mbox | patch
Permalink /patch/68089/
State New
Headers show

Comments

Chong.Lu@windriver.com - March 6, 2014, 8:06 a.m.
If image contains dbus and ptest is in DISTRO_FEATURES, dbus-ptest package
is installed, regardless of whether ptest-pkgs is in IMAGE_FEATURES. This
issue will increase size for most small images.
This patch fixes this problem.

[YOCTO #5702]

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 meta/recipes-core/dbus/{dbus-ptest_1.6.18.bb => dbus-test_1.6.18.bb} | 0
 meta/recipes-core/dbus/dbus.inc                                      | 5 ++++-
 2 files changed, 4 insertions(+), 1 deletion(-)
 rename meta/recipes-core/dbus/{dbus-ptest_1.6.18.bb => dbus-test_1.6.18.bb} (100%)
Ross Burton - March 6, 2014, 10:04 a.m.
On 6 March 2014 08:06, Chong Lu <Chong.Lu@windriver.com> wrote:
> +PACKAGES += "dbus-ptest"
> +ALLOW_EMPTY_${PN}-ptest = "1"
> +RDEPENDS_${PN}-ptest = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs', 'dbus-test-ptest', 'dbus-test', d)}"

Nice idea, but wouldn't a more correct solution be to have dbus-ptest
added to PACKAGES conditionally (instead of always generating
dbus-ptest and conditionally adding the dependency)?

Ross
Chong.Lu@windriver.com - March 7, 2014, 2:13 a.m.
On 03/06/2014 06:04 PM, Burton, Ross wrote:
> On 6 March 2014 08:06, Chong Lu <Chong.Lu@windriver.com> wrote:
>> +PACKAGES += "dbus-ptest"
>> +ALLOW_EMPTY_${PN}-ptest = "1"
>> +RDEPENDS_${PN}-ptest = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs', 'dbus-test-ptest', 'dbus-test', d)}"
> Nice idea, but wouldn't a more correct solution be to have dbus-ptest
> added to PACKAGES conditionally (instead of always generating
> dbus-ptest and conditionally adding the dependency)?
>
> Ross
>
>
Hi Ross,

Do you mean using PACKAGES += "${@base_contains('IMAGE_FEATURES', 
'ptest-pkgs', 'dbus-ptest-ptest', 'dbus-ptest', d)}" or something else?


Best Regards
Chong
Ross Burton - March 10, 2014, 11:51 a.m.
On 7 March 2014 02:13, Chong Lu <Chong.Lu@windriver.com> wrote:
> Do you mean using PACKAGES += "${@base_contains('IMAGE_FEATURES',
> 'ptest-pkgs', 'dbus-ptest-ptest', 'dbus-ptest', d)}" or something else?

Clearly I wasn't thinking clearly last week.  You can't check
IMAGE_FEATURES in a non-image recipe so this isn't a good solution.

Ross
Chong.Lu@windriver.com - March 13, 2014, 9:54 a.m.
On 03/06/2014 06:04 PM, Burton, Ross wrote:
> On 6 March 2014 08:06, Chong Lu <Chong.Lu@windriver.com> wrote:
>> +PACKAGES += "dbus-ptest"
>> +ALLOW_EMPTY_${PN}-ptest = "1"
>> +RDEPENDS_${PN}-ptest = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs', 'dbus-test-ptest', 'dbus-test', d)}"
Hi Ross,

Do you have any suggestion about this issue?
If we don't check IMAGE_FEATURES, I have no way to resolve this problem 
that only build but not install ptest. I'm very confused.

Best Regards
Chong

> Nice idea, but wouldn't a more correct solution be to have dbus-ptest
> added to PACKAGES conditionally (instead of always generating
> dbus-ptest and conditionally adding the dependency)?
>
> Ross
> Clearly I wasn't thinking clearly last week.  You can't check
> IMAGE_FEATURES in a non-image recipe so this isn't a good solution.
>
> Ross
>
>
Paul Eggleton - March 13, 2014, 10:01 a.m.
On Thursday 13 March 2014 17:54:03 Chong Lu wrote:
> On 03/06/2014 06:04 PM, Burton, Ross wrote:
> > On 6 March 2014 08:06, Chong Lu <Chong.Lu@windriver.com> wrote:
> >> +PACKAGES += "dbus-ptest"
> >> +ALLOW_EMPTY_${PN}-ptest = "1"
> >> +RDEPENDS_${PN}-ptest = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs',
> >> 'dbus-test-ptest', 'dbus-test', d)}"
> >
> > Clearly I wasn't thinking clearly last week.  You can't check
> > IMAGE_FEATURES in a non-image recipe so this isn't a good solution.
> 
> Do you have any suggestion about this issue?
> If we don't check IMAGE_FEATURES, I have no way to resolve this problem
> that only build but not install ptest. I'm very confused.

This should check DISTRO_FEATURES, not IMAGE_FEATURES. Assuming ptest is in 
DISTRO_FEATURES, even if ptest is not in IMAGE_FEATURES it doesn't matter if 
the dependency between dbus-ptest and dbus-ptest-ptest exists because dbus-
ptest itself shouldn't be in the image, so dbus-ptest-ptest shouldn't be 
pulled in either. Does that make sense?

Cheers,
Paul
Paul Eggleton - March 13, 2014, 10:48 a.m.
On Thursday 13 March 2014 10:01:10 Paul Eggleton wrote:
> On Thursday 13 March 2014 17:54:03 Chong Lu wrote:
> > On 03/06/2014 06:04 PM, Burton, Ross wrote:
> > > On 6 March 2014 08:06, Chong Lu <Chong.Lu@windriver.com> wrote:
> > >> +PACKAGES += "dbus-ptest"
> > >> +ALLOW_EMPTY_${PN}-ptest = "1"
> > >> +RDEPENDS_${PN}-ptest = "${@base_contains('IMAGE_FEATURES',
> > >> 'ptest-pkgs',
> > >> 'dbus-test-ptest', 'dbus-test', d)}"
> > > 
> > > Clearly I wasn't thinking clearly last week.  You can't check
> > > IMAGE_FEATURES in a non-image recipe so this isn't a good solution.
> > 
> > Do you have any suggestion about this issue?
> > If we don't check IMAGE_FEATURES, I have no way to resolve this problem
> > that only build but not install ptest. I'm very confused.
> 
> This should check DISTRO_FEATURES, not IMAGE_FEATURES.

Actually even a check on DISTRO_FEATURES may not be needed; if ${PN}-ptest is 
not in PACKAGES then RDEPENDS_${PN}-ptest should be ignored completely.

Cheers,
Paul

Patch

diff --git a/meta/recipes-core/dbus/dbus-ptest_1.6.18.bb b/meta/recipes-core/dbus/dbus-test_1.6.18.bb
similarity index 100%
rename from meta/recipes-core/dbus/dbus-ptest_1.6.18.bb
rename to meta/recipes-core/dbus/dbus-test_1.6.18.bb
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index 677ff78..292bef6 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -6,7 +6,6 @@  LICENSE = "AFL-2 | GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
                     file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
 DEPENDS = "expat virtual/libintl"
-RDEPENDS_dbus = "${@base_contains('DISTRO_FEATURES', 'ptest', 'dbus-ptest-ptest', '', d)}"
 RDEPENDS_dbus_class-native = ""
 RDEPENDS_dbus_class-nativesdk = ""
 
@@ -151,3 +150,7 @@  do_install_class-nativesdk() {
 	rm -rf ${D}${localstatedir}/run
 }
 BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES += "dbus-ptest"
+ALLOW_EMPTY_${PN}-ptest = "1"
+RDEPENDS_${PN}-ptest = "${@base_contains('IMAGE_FEATURES', 'ptest-pkgs', 'dbus-test-ptest', 'dbus-test', d)}"