Patchwork [meta-oe,2/2] systemd.bbclass: Unbreak systemd support for recipes with SYSTEMD_SERVICE without extension

login
register
mail settings
Submitter Andreas Müller
Date May 26, 2012, 5:51 p.m.
Message ID <1338054697-9996-2-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/28841/
State Superseded
Headers show

Comments

Andreas Müller - May 26, 2012, 5:51 p.m.
To set service files the following syntax is allowed:

SYSTEMD_SERVICE = <service_file>
or
SYSTEMD_SERVICE_{<systemd_package_name>} = <service_file>

First option was broken by

author	Martin Jansa <Martin.Jansa@gmail.com>	2012-04-24 13:11:44 (GMT)
commit	154d0bb399ce6a0bdc2bf756d1a8a9c77dd0a755
systemd.bbclass: allow recipe to inherit systemd with empty SYSTEMD_SERVICE

The error was discoverd for networkmanager.

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
 meta-oe/classes/systemd.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index 1edd1e4..c04b71a 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -190,7 +190,8 @@  python populate_packages_prepend () {
 	# run all modifications once when creating package
 	if os.path.exists('${D}'):
 		for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
-			if d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) and d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1).strip():
+			systemd_services = d.getVar('SYSTEMD_SERVICE' + "_" + pkg_systemd, 1) or d.getVar('SYSTEMD_SERVICE', 1) or ""
+			if systemd_services != "":
 				systemd_generate_package_scripts(pkg_systemd)
 				systemd_add_rdepends(pkg_systemd)
 		systemd_check_services()