[OE-core] [PATCH 40/42] systemd.bbclass: Remove user services too if systemd is not enabled
Pau Espin Pedrol
pespin.shar at gmail.com
Sun Mar 13 19:13:38 UTC 2016
* Also change naming related to unitdir, as it's quite misleading because
in here we are removing more stuff (parent directory) than just unitdir.
Signed-off-by: Pau Espin Pedrol <pespin.shar at gmail.com>
---
meta/classes/systemd.bbclass | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index db7873f..9574cbd 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -179,17 +179,24 @@ python systemd_populate_packages() {
PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
-python rm_systemd_unitdir (){
+python rm_systemd_dir (){
import shutil
if not bb.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)
- systemd_libdir = os.path.dirname(systemd_unitdir)
+ systemd_system_dir = oe.path.join(d.getVar("D", True), d.getVar('nonarch_base_libdir', True), 'systemd')
+ if os.path.exists(systemd_system_dir):
+ shutil.rmtree(systemd_system_dir)
+ systemd_libdir = os.path.dirname(systemd_system_dir)
+ if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
+ os.rmdir(systemd_libdir)
+
+ systemd_user_dir = oe.path.join(d.getVar("D", True), d.getVar('nonarch_libdir', True), 'systemd')
+ if os.path.exists(systemd_user_dir):
+ shutil.rmtree(systemd_user_dir)
+ systemd_libdir = os.path.dirname(systemd_user_dir)
if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
os.rmdir(systemd_libdir)
}
-do_install[postfuncs] += "rm_systemd_unitdir "
+do_install[postfuncs] += "rm_systemd_dir "
python rm_sysvinit_initddir (){
import shutil
--
2.7.1
More information about the Openembedded-core
mailing list