]> code.ossystems Code Review - openembedded-core.git/commitdiff
shutdown-desktop: give entire path in Exec field
authorLaurentiu Palcu <laurentiu.palcu@intel.com>
Wed, 3 Jul 2013 14:16:46 +0000 (17:16 +0300)
committerSaul Wold <sgw@linux.intel.com>
Tue, 9 Jul 2013 14:56:12 +0000 (07:56 -0700)
A normal user does not have /sbin in its PATH, by default, so having the
entire path here allows the correct execution when run as regular user.

[YOCTO #4345]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb

index c5096c15309adb0db0a8b1be547a0edbc62f8b32..773b438054aad5ad980226e34e75a4d6a9bc40f7 100644 (file)
@@ -12,11 +12,13 @@ S = "${WORKDIR}"
 do_install() {
        install -d ${D}${datadir}/applications
        install -m 0644 shutdown.desktop ${D}${datadir}/applications/
+
+       sed -i ${D}${datadir}/applications/shutdown.desktop -e 's#^Exec=\(.*\)#Exec=${base_sbindir}/\1#'
 }
 
 pkg_postinst_${PN} () {
     grep -q qemuarm $D${sysconfdir}/hostname && \
-        sed -i $D${datadir}/applications/shutdown.desktop -e 's/^Exec=halt/Exec=reboot/' \
+        sed -i $D${datadir}/applications/shutdown.desktop -e 's#^Exec=\(.*\)/halt#Exec=\1/reboot#' \
         || true
 }