summaryrefslogtreecommitdiffstats
path: root/meta/classes/systemd.bbclass
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/systemd.bbclass
parent82233cd647b1ecc256afb0c3378906cf8af46f8e (diff)
downloadpoky-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/systemd.bbclass')
-rw-r--r--meta/classes/systemd.bbclass15
1 files changed, 7 insertions, 8 deletions
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 7a8d35cd2f..efc1adcacb 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -12,13 +12,12 @@ SYSTEMD_AUTO_ENABLE ??= "enable"
12# even if systemd is not in DISTRO_FEATURES. As such don't make any changes 12# even if systemd is not in DISTRO_FEATURES. As such don't make any changes
13# directly but check the DISTRO_FEATURES first. 13# directly but check the DISTRO_FEATURES first.
14python __anonymous() { 14python __anonymous() {
15 features = d.getVar("DISTRO_FEATURES", True).split()
16 # If the distro features have systemd but not sysvinit, inhibit update-rcd 15 # If the distro features have systemd but not sysvinit, inhibit update-rcd
17 # from doing any work so that pure-systemd images don't have redundant init 16 # from doing any work so that pure-systemd images don't have redundant init
18 # files. 17 # files.
19 if "systemd" in features: 18 if oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
20 d.appendVar("DEPENDS", " systemd-systemctl-native") 19 d.appendVar("DEPENDS", " systemd-systemctl-native")
21 if "sysvinit" not in features: 20 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
22 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") 21 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
23} 22}
24 23
@@ -52,7 +51,7 @@ fi
52systemd_populate_packages[vardeps] += "systemd_prerm systemd_postinst" 51systemd_populate_packages[vardeps] += "systemd_prerm systemd_postinst"
53 52
54python systemd_populate_packages() { 53python systemd_populate_packages() {
55 if "systemd" not in d.getVar("DISTRO_FEATURES", True).split(): 54 if not oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
56 return 55 return
57 56
58 def get_package_var(d, var, pkg): 57 def get_package_var(d, var, pkg):
@@ -167,7 +166,7 @@ PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
167 166
168python rm_systemd_unitdir (){ 167python rm_systemd_unitdir (){
169 import shutil 168 import shutil
170 if "systemd" not in d.getVar("DISTRO_FEATURES", True).split(): 169 if not oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
171 systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True)) 170 systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
172 if os.path.exists(systemd_unitdir): 171 if os.path.exists(systemd_unitdir):
173 shutil.rmtree(systemd_unitdir) 172 shutil.rmtree(systemd_unitdir)
@@ -181,9 +180,9 @@ python rm_sysvinit_initddir (){
181 import shutil 180 import shutil
182 sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d")) 181 sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d"))
183 182
184 if ("systemd" in d.getVar("DISTRO_FEATURES", True).split() and 183 if oe.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
185 "sysvinit" not in d.getVar("DISTRO_FEATURES", True).split() and 184 not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
186 os.path.exists(sysv_initddir)): 185 os.path.exists(sysv_initddir):
187 systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True), "system") 186 systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True), "system")
188 187
189 # If systemd_unitdir contains anything, delete sysv_initddir 188 # If systemd_unitdir contains anything, delete sysv_initddir