Patchwork [meta-oe,V3,05/23] systemd.bbclass: automatically create packages set in SYSTEMD_PACKAGES

login
register
mail settings
Submitter Andreas Müller
Date Feb. 23, 2012, 12:10 p.m.
Message ID <1329999054-23112-6-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/21641/
State Accepted
Headers show

Comments

Andreas Müller - Feb. 23, 2012, 12:10 p.m.
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Acked-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta-oe/classes/systemd.bbclass |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index 6517357..e779bef 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -63,8 +63,17 @@  def systemd_after_parse(d):
 				if systemd_services == "":
 					raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_SERVICE / %s" % (bb_filename, service_pkg)
 
+	# prepend systemd-packages not already included
+	def systemd_create_package(pkg_systemd):
+		packages = d.getVar('PACKAGES', 1)
+		if not pkg_systemd in packages:
+			packages = "%s %s" % (pkg_systemd, packages)
+			d.setVar('PACKAGES', packages)
+
 
 	systemd_check_vars()
+	for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
+		systemd_create_package(pkg_systemd)
 
 
 python __anonymous() {