From 6ab56c54f316154d89f03ec0c6c2cb39d1736cff Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 4 Dec 2013 13:09:11 +0000 Subject: classes/recipes: More optimal DISTRO_FEATURES references Using the contains function results in more optimal sstate checksums resulting in better cache reuse as we as more consistent code. (From OE-Core rev: 9c93526756e7cbbff027c88eb972f877bcb1f057) Signed-off-by: Richard Purdie --- meta/recipes-devtools/gcc/gcc-common.inc | 4 ++-- meta/recipes-devtools/opkg/opkg.inc | 2 +- meta/recipes-devtools/perl/perl-ptest.inc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc index cc0ab2afbd..55c61850b6 100644 --- a/meta/recipes-devtools/gcc/gcc-common.inc +++ b/meta/recipes-devtools/gcc/gcc-common.inc @@ -19,7 +19,7 @@ def get_gcc_fpu_setting(bb, d): get_gcc_fpu_setting[vardepvalue] = "${@get_gcc_fpu_setting(bb, d)}" def get_gcc_mips_plt_setting(bb, d): - if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and 'mplt' in d.getVar('DISTRO_FEATURES',1).split() : + if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and oe.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d): return "--with-mips-plt" return "" @@ -32,7 +32,7 @@ def get_gcc_multiarch_setting(bb, d): "sparc": "--enable-targets=all", } - if 'multiarch' in d.getVar('DISTRO_FEATURES', True).split() : + if oe.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d): if target_arch in multiarch_options : return multiarch_options[target_arch] return "" diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc index 1076472779..4ffd430b3f 100644 --- a/meta/recipes-devtools/opkg/opkg.inc +++ b/meta/recipes-devtools/opkg/opkg.inc @@ -18,7 +18,7 @@ do_configure_prepend() { inherit autotools pkgconfig systemd python () { - if 'sysvinit' not in d.getVar("DISTRO_FEATURES", True).split(): + if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): pn = d.getVar('PN', True) d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'opkg-configure.service') } diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc index 6999e6be37..914ca0f4c0 100644 --- a/meta/recipes-devtools/perl/perl-ptest.inc +++ b/meta/recipes-devtools/perl/perl-ptest.inc @@ -42,7 +42,7 @@ python populate_packages_prepend() { # Put all *.t files from the lib dir in the ptest package # do_split_packages requires a pair of () in the regex, but we have nothing # to match, so use an empty pair. - if "ptest" in d.getVar("DISTRO_FEATURES", True).split(): + if oe.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d): do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()', '${PN}-ptest%s', '%s', recursive=True, match_path=True) } -- cgit v1.2.3-54-g00ecf