[oe-commits] Koen Kooi : Revert "systemd.bbclass: drop postrm, use prerm instead"

git at git.openembedded.org git at git.openembedded.org
Mon May 21 12:08:23 UTC 2012


Module: meta-openembedded.git
Branch: master
Commit: f6330ed09c8632845410c0a75d629ecbae874382
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=f6330ed09c8632845410c0a75d629ecbae874382

Author: Koen Kooi <koen at dominion.thruhere.net>
Date:   Mon May 21 14:07:25 2012 +0200

Revert "systemd.bbclass: drop postrm, use prerm instead"

This removed the $D check, which should stay

This reverts commit 637cb7e3d2cfdc74d239a4257e6f3477aa17da4e.

---

 meta-oe/classes/systemd.bbclass |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index 1edd1e4..db35717 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -15,7 +15,12 @@ fi
 }
 
 systemd_prerm() {
-systemctl stop ${SYSTEMD_SERVICE}
+if [ -z "$D" ]; then
+    systemctl stop ${SYSTEMD_SERVICE}
+fi
+}
+
+systemd_postrm() {
 systemctl disable ${SYSTEMD_SERVICE}
 }
 
@@ -88,7 +93,7 @@ do_install_append() {
 
 python populate_packages_prepend () {
 	def systemd_generate_package_scripts(pkg):
-		bb.debug(1, 'adding systemd calls to postinst/prerm for %s' % 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)
 		bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata)
@@ -111,6 +116,12 @@ 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)
+		bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
+
 	# add files to FILES_*-systemd if existent and not already done
 	def systemd_append_file(pkg_systemd, file_append):
 		appended = False





More information about the Openembedded-commits mailing list