Patchwork [meta-oe,4/7] systemd.bbclass: automatically create packages set in SYSTEMD_PACKAGES

login
register
mail settings
Submitter Andreas Müller
Date Feb. 11, 2012, 2 a.m.
Message ID <1328925603-2967-4-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/21157/
State Accepted
Commit 71f61f799c3102680f6b78179c1b1d6b837ed8b4
Headers show

Comments

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

On Sat, Feb 11, 2012 at 00:00, Andreas Müller
<schnitzeltony@googlemail.com>wrote:

>
> Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
> ---
>  meta-oe/classes/systemd.bbclass |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/meta-oe/classes/systemd.bbclass
> b/meta-oe/classes/systemd.bbclass
> index 7ec4ca4..ffcabe9 100644
> --- a/meta-oe/classes/systemd.bbclass
> +++ b/meta-oe/classes/systemd.bbclass
> @@ -57,8 +57,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() {
> --
> 1.7.4.4
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index 7ec4ca4..ffcabe9 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -57,8 +57,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() {