summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-04 13:09:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-05 14:24:43 +0000
commit6ab56c54f316154d89f03ec0c6c2cb39d1736cff (patch)
tree952d5bde1c81457378d6d995051cd04674dbf489 /meta/classes
parent82233cd647b1ecc256afb0c3378906cf8af46f8e (diff)
downloadast2050-yocto-poky-6ab56c54f316154d89f03ec0c6c2cb39d1736cff.zip
ast2050-yocto-poky-6ab56c54f316154d89f03ec0c6c2cb39d1736cff.tar.gz
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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/libc-package.bbclass6
-rw-r--r--meta/classes/systemd.bbclass15
-rw-r--r--meta/classes/update-rc.d.bbclass2
3 files changed, 11 insertions, 12 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
index 454ee76..0af42a0 100644
--- a/meta/classes/libc-package.bbclass
+++ b/meta/classes/libc-package.bbclass
@@ -36,10 +36,10 @@ python __anonymous () {
d.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "compile")
break
- distro_features = (d.getVar('DISTRO_FEATURES', True) or '').split()
-
# try to fix disable charsets/locales/locale-code compile fail
- if 'libc-charsets' in distro_features and 'libc-locales' in distro_features and 'libc-locale-code' in distro_features:
+ if oe.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
+ oe.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
+ oe.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
d.setVar('PACKAGE_NO_GCONV', '0')
else:
d.setVar('PACKAGE_NO_GCONV', '1')
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 7a8d35c..efc1adc 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -12,13 +12,12 @@ SYSTEMD_AUTO_ENABLE ??= "enable"
# even if systemd is not in DISTRO_FEATURES. As such don't make any changes
# directly but check the DISTRO_FEATURES first.
python __anonymous() {
- features = d.getVar("DISTRO_FEATURES", True).split()
# If the distro features have systemd but not sysvinit, inhibit update-rcd
# from doing any work so that pure-systemd images don't have redundant init
# files.
- if "systemd" in features:
+ if oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
d.appendVar("DEPENDS", " systemd-systemctl-native")
- if "sysvinit" not in features:
+ if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
}
@@ -52,7 +51,7 @@ fi
systemd_populate_packages[vardeps] += "systemd_prerm systemd_postinst"
python systemd_populate_packages() {
- if "systemd" not in d.getVar("DISTRO_FEATURES", True).split():
+ if not oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
return
def get_package_var(d, var, pkg):
@@ -167,7 +166,7 @@ PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
python rm_systemd_unitdir (){
import shutil
- if "systemd" not in d.getVar("DISTRO_FEATURES", True).split():
+ if not oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
if os.path.exists(systemd_unitdir):
shutil.rmtree(systemd_unitdir)
@@ -181,9 +180,9 @@ python rm_sysvinit_initddir (){
import shutil
sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d"))
- if ("systemd" in d.getVar("DISTRO_FEATURES", True).split() and
- "sysvinit" not in d.getVar("DISTRO_FEATURES", True).split() and
- os.path.exists(sysv_initddir)):
+ if oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
+ not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+ os.path.exists(sysv_initddir):
systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True), "system")
# If systemd_unitdir contains anything, delete sysv_initddir
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 29b5a8e..c9bf04c 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -105,7 +105,7 @@ python populate_packages_updatercd () {
# Check that this class isn't being inhibited (generally, by
# systemd.bbclass) before doing any work.
- if "sysvinit" in d.getVar("DISTRO_FEATURES").split() or \
+ if oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
if pkgs == None:
OpenPOWER on IntegriCloud