Skip to content

Commit

Permalink
Revert "systemd.bbclass: drop postrm, use prerm instead"
Browse files Browse the repository at this point in the history
This removed the $D check, which should stay

This reverts commit 637cb7e.
  • Loading branch information
koenkooi committed May 21, 2012
1 parent 72ab8b0 commit f6330ed
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions meta-oe/classes/systemd.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit f6330ed

Please sign in to comment.