systemd: Remove systemd_unitdir if systemd is not in distro features
authorMuhammad Shakeel <muhammad_shakeel@mentor.com>
Fri, 19 Jul 2013 11:53:25 +0000 (16:53 +0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 24 Jul 2013 10:35:39 +0000 (11:35 +0100)
If systemd is not supported DISTRO_FEATURE than there is no need to
package related service files.

(From OE-Core rev: ac5d20f4adac69ea1702694fb50849c9e465b443)

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/systemd.bbclass

index 0447e53..9763faa 100644 (file)
@@ -161,3 +161,12 @@ python systemd_populate_packages() {
 }
 
 PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
+
+python rm_systemd_unitdir (){
+    import shutil
+    if "systemd" not in d.getVar("DISTRO_FEATURES", True).split():
+        systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
+        if os.path.exists(systemd_unitdir):
+            shutil.rmtree(systemd_unitdir)
+}
+do_install[postfuncs] += "rm_systemd_unitdir "