Patchwork [meta-oe,3/7] systemd.bbclass: cosmetics

login
register
mail settings
Submitter Andreas Müller
Date Feb. 11, 2012, 1:59 a.m.
Message ID <1328925603-2967-3-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/21167/
State Superseded
Headers show

Comments

Andreas Müller - Feb. 11, 2012, 1:59 a.m.
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
 meta-oe/classes/systemd.bbclass |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
Otavio Salvador - Feb. 11, 2012, 1:15 p.m.
On Fri, Feb 10, 2012 at 23:59, Andreas Müller
<schnitzeltony@googlemail.com>wrote:

>  python populate_packages_prepend () {
> -       def systemd_package(pkg):
> +       def systemd_prepost_instrm(pkg):
>

I fully agree about renaming it but wouldn't
systemd_generate_package_scripts(pkg) be more descriptive?
Andreas Müller - Feb. 12, 2012, 9:53 p.m.
On Sat, Feb 11, 2012 at 2:15 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> On Fri, Feb 10, 2012 at 23:59, Andreas Müller
> <schnitzeltony@googlemail.com>wrote:
>
>>  python populate_packages_prepend () {
>> -       def systemd_package(pkg):
>> +       def systemd_prepost_instrm(pkg):
>>
>
> I fully agree about renaming it but wouldn't
> systemd_generate_package_scripts(pkg) be more descriptive?
>
V2 will get that

Andreas

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index bc83908..7ec4ca4 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -66,7 +66,7 @@  python __anonymous() {
 }
 
 python populate_packages_prepend () {
-	def systemd_package(pkg):
+	def systemd_prepost_instrm(pkg):
 		bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
 		localdata = bb.data.createCopy(d)
 		overrides = bb.data.getVar("OVERRIDES", localdata, 1)
@@ -90,10 +90,10 @@  python populate_packages_prepend () {
 		prerm += bb.data.getVar('systemd_prerm', localdata, 1)
 		bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d)
 
-	        postrm = bb.data.getVar('pkg_postrm', localdata, 1)
-	        if not postrm:
-	                postrm = '#!/bin/sh\n'
-                postrm += bb.data.getVar('systemd_postrm', localdata, 1)
+		postrm = bb.data.getVar('pkg_postrm', localdata, 1)
+		if not postrm:
+			postrm = '#!/bin/sh\n'
+		postrm += bb.data.getVar('systemd_postrm', localdata, 1)
 		bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
 
 		rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
@@ -101,7 +101,6 @@  python populate_packages_prepend () {
 		bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
 
 
-	pkgs = bb.data.getVar('SYSTEMD_PACKAGES', d, 1)
-	for pkg in pkgs.split():
-		systemd_package(pkg)
+	for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
+		systemd_prepost_instrm(pkg_systemd)
 }