update-rc.d.bbclass: honor $D as well in updatercd_postrm
authorJohn Lee <john_lee@openmoko.org>
Mon, 22 Dec 2008 06:17:22 +0000 (14:17 +0800)
committerJohn Lee <john_lee@openmoko.org>
Mon, 22 Dec 2008 06:27:24 +0000 (14:27 +0800)
Without this, postrm script will try to remove service on the host
system in a toolchain environment.

Patch created by Christopher Hall <hsw@openmoko.com>

classes/update-rc.d.bbclass

index 9b832c0..6328193 100644 (file)
@@ -21,7 +21,12 @@ fi
 }
 
 updatercd_postrm() {
-update-rc.d $D ${INITSCRIPT_NAME} remove
+if test "x$D" != "x"; then
+       OPT="-r $D"
+else
+       OPT=""
+fi
+update-rc.d $OPT ${INITSCRIPT_NAME} remove
 }