]> code.ossystems Code Review - openembedded-core.git/commitdiff
update-rc.d.bbclass: Fix host/target test in postinst
authorJacob Kroon <jacob.kroon@gmail.com>
Sun, 27 Oct 2013 09:20:29 +0000 (10:20 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Oct 2013 10:45:19 +0000 (10:45 +0000)
When running the postinst script I get a shell warning:

sh: argument expected

and the service is never stopped. This patch fixes the warning
message and stops the service.

Patch v2: Hans Beckérus pointed out that the patch is not correct.
          This version uses the syntax proposed by Hans. I've tested
          that the postinst script works correctly when run on the target,
          both when the init script exists and when it doesn't exist.

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/update-rc.d.bbclass

index e14659d118487ab0825a57468cfe4b2a674b5630..9437e9cc317806c7c7db54f5bc8f3a3df97da6cf 100644 (file)
@@ -16,7 +16,7 @@ updatercd_postinst() {
 # test if there is a previous init script there, ie, we are updating the package
 # if so, we stop the service and remove it before we install from the new package
 if type update-rc.d >/dev/null 2>/dev/null; then
-       if [ -z "$D" -a `test -f "${INIT_D_DIR}/${INITSCRIPT_NAME}"` ]; then
+       if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
                ${INIT_D_DIR}/${INITSCRIPT_NAME} stop
        fi
        if [ -n "$D" ]; then