security-server: Prevent running ldconfig or systemctl if... 73/57473/1
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Wed, 20 Jan 2016 09:33:25 +0000 (10:33 +0100)
committerPhilippe Coval <philippe.coval@osg.samsung.com>
Wed, 20 Jan 2016 09:40:43 +0000 (10:40 +0100)
This should be executed on system and not on build host.
Note It might worth to rewrite all recipes that involve systemd
and inherit systemd class when possible (check how for user sessions).

Without this change,
bitbake tries to run ldconfig on host instead
and then complains (but not fail !) about permission issue like :

   /sbin/ldconfig.real: \
   Can't create temporary cache file /etc/ld.so.cache~: \
   Permission denied

Note, "or condition" is prefered because of shell's -e option.

Change-Id: Ib519697d4df1b9754e34ba030eb5b4ebf8c3ad92
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
meta-tizen-common-base/recipes-security/security-server/security-server.inc

index b3fbc39..90daf21 100644 (file)
@@ -157,14 +157,17 @@ do_install() {
 pkg_postinst_${PN}() {
     #!/bin/sh -e
 
-    ldconfig
-    systemctl daemon-reload
-    if [ $1 = 1 ]; then
+    [ "" != "$D" ] || ldconfig
+
     # installation
+    if [ $1 = 1 ]; then
+        systemctl daemon-reload
         systemctl start security-server.service
     fi
-    if [ $1 = 2 ]; then
+
     # update
+    if [ $1 = 2 ]; then
+        systemctl daemon-reload
         systemctl restart security-server.service
     fi
 
@@ -195,7 +198,7 @@ pkg_postrm_libsecurity-server-client() {
 pkg_postrm_${PN}() {
     #!/bin/sh -e
 
-    ldconfig
+    [ "" != "$D" ] || ldconfig
     if [ $1 = 0 ]; then
     # unistall
         systemctl daemon-reload