provide both postrm and prerm for update-rc.d users
authorPhil Blundell <philb@gnu.org>
Tue, 28 Jun 2005 12:51:44 +0000 (12:51 +0000)
committerPhil Blundell <philb@gnu.org>
Tue, 28 Jun 2005 12:51:44 +0000 (12:51 +0000)
BKrev: 42c147e0CkwnoUmrLRuV35U7XC-5iQ

classes/update-rc.d.bbclass

index ffa5d49..0bfba46 100644 (file)
@@ -20,6 +20,9 @@ if test "x$D" != "x"; then
 else
        ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
 fi
+}
+
+updatercd_postrm() {
 update-rc.d $D ${INITSCRIPT_NAME} remove
 }
 
@@ -49,6 +52,11 @@ python populate_packages_prepend () {
                        prerm = '#!/bin/sh\n'
                prerm += bb.data.getVar('updatercd_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('updatercd_postrm', localdata, 1)
+               bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
 
        pkgs = bb.data.getVar('INITSCRIPT_PACKAGES', d, 1)
        if pkgs == None: