Patchwork [1/2] systemd: Remove systemd_unitdir if systemd is not in distro features

login
register
mail settings
Submitter Shakeel, Muhammad
Date July 19, 2013, 11:53 a.m.
Message ID <1374234806-31680-1-git-send-email-muhammad_shakeel@mentor.com>
Download mbox | patch
Permalink /patch/54063/
State Accepted
Commit ac5d20f4adac69ea1702694fb50849c9e465b443
Headers show

Comments

Shakeel, Muhammad - July 19, 2013, 11:53 a.m.
From: Muhammad Shakeel <muhammad_shakeel@mentor.com>

If systemd is not supported DISTRO_FEATURE than there is no need to
package related service files.

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
---
 meta/classes/systemd.bbclass |    9 +++++++++
 1 file changed, 9 insertions(+)
Ross Burton - July 23, 2013, 1:59 p.m.
On 19 July 2013 12:53, Shakeel, Muhammad <muhammad_shakeel@mentor.com> wrote:
> If systemd is not supported DISTRO_FEATURE than there is no need to
> package related service files.

When this is merged can you follow this up with a series to remove all
of the conditional installations in oe-core?

Cheers,
Ross
Shakeel, Muhammad - July 24, 2013, 6:57 a.m.
On 07/23/2013 06:59 PM, Burton, Ross wrote:
> On 19 July 2013 12:53, Shakeel, Muhammad <muhammad_shakeel@mentor.com> wrote:
>> If systemd is not supported DISTRO_FEATURE than there is no need to
>> package related service files.
> When this is merged can you follow this up with a series to remove all
> of the conditional installations in oe-core?
>
> Cheers,
> Ross
Yes, I intend to follow this up with removal of conditional check for 
service file installation.

Thanks,
Shakeel

Patch

diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 0447e53..9763faa 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -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 "