[5/5,v6] systemd: Remove base_libdir if installed only for systemd_unitdir

Submitted by Shakeel, Muhammad on Sept. 4, 2013, 11:05 a.m. | Patch ID: 57343


Message ID 1378292703-10358-5-git-send-email-muhammad_shakeel@mentor.com
State New
Headers show

Commit Message

Shakeel, Muhammad Sept. 4, 2013, 11:05 a.m.
From: Muhammad Shakeel <muhammad_shakeel@mentor.com>

If a recipe installs systemd_unitdir and it is a non-systemd build than
systemd.bbclass deletes systemd_unitdir (/lib/systemd/) but not
base_libdir (/lib). In this case if base_libdir is empty than following
QA Issue is reported.

ERROR: QA Issue: openssh: Files/directories were installed but not shipped

If base_libdir was installed due to systemd_unitdir installation than for
non-systemd build it should also be removed.

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
 meta/classes/systemd.bbclass |    3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
index 76f0e7d..8ec4992 100644
--- a/meta/classes/systemd.bbclass
+++ b/meta/classes/systemd.bbclass
@@ -168,6 +168,9 @@  python rm_systemd_unitdir (){
         systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
         if os.path.exists(systemd_unitdir):
+        base_libdir = oe.path.join(d.getVar("D", True), d.getVar('base_libdir', True))
+        if (os.path.exists(base_libdir) and not os.listdir(base_libdir)):
+            os.rmdir(base_libdir)
 do_install[postfuncs] += "rm_systemd_unitdir "