summaryrefslogtreecommitdiff
path: root/classes/update-rc.d.bbclass
diff options
context:
space:
mode:
authorFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2009-10-26 12:19:54 +0100
committerFrans Meulenbroeks <fransmeulenbroeks@gmail.com>2009-10-26 12:19:54 +0100
commit4882a87cc59eb6c984a4b95507c4f01fed2f6079 (patch)
treed4e13c32297caacf790ea68ba97d56977dd71716 /classes/update-rc.d.bbclass
parent8afa9e311db005dc86f23fb0fa6c89b57f7bf474 (diff)
parentdba8dec4093dc68610b762c8c7ac4e38c31cc8f9 (diff)
Merge branch 'org.openembedded.dev' of git.openembedded.org:openembedded into org.openembedded.dev
Diffstat (limited to 'classes/update-rc.d.bbclass')
-rw-r--r--classes/update-rc.d.bbclass14
1 files changed, 12 insertions, 2 deletions
diff --git a/classes/update-rc.d.bbclass b/classes/update-rc.d.bbclass
index 91af859392..00ec37cfb8 100644
--- a/classes/update-rc.d.bbclass
+++ b/classes/update-rc.d.bbclass
@@ -16,17 +16,27 @@ update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
updatercd_prerm() {
if test "x$D" = "x"; then
- ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+ if test "$1" = "upgrade" -o "$1" = "remove"; then
+ ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+ fi
fi
}
+# Note: to be Debian compliant, we should only invoke update-rc.d remove
+# at the "purge" step, but opkg does not support it. So instead we also
+# run it at the "remove" step if the init script no longer exists.
+
updatercd_postrm() {
if test "x$D" != "x"; then
OPT="-r $D"
else
OPT=""
fi
-update-rc.d $OPT ${INITSCRIPT_NAME} remove
+if test "$1" = "remove" -o "$1" = "purge"; then
+ if ! test -e "${INIT_D_DIR}/${INITSCRIPT_NAME}"; then
+ update-rc.d $OPT ${INITSCRIPT_NAME} remove
+ fi
+fi
}