dbus: modified to use renamed tool
[platform/upstream/meta-generic.git] / scripts / generic-dbus-policychecker.post
index c42a55f..c97719a 100644 (file)
@@ -1,9 +1,23 @@
 #!/bin/sh
 echo "#################### generic-dbus-policychecker.post ####################"
-if [ -x /usr/bin/dbus-policychecker ] ; then
+if [ -x /usr/bin/dbuspolicy-checker ] ; then
+       fail_cnt=0
        for f in /etc/dbus-1/system.d/*.conf; do
                echo
                echo "$0: Checking D-Bus policy file: $f"
-               /usr/bin/dbus-policychecker "$f"
+               result=$(/usr/bin/dbuspolicy-checker "$f")
+               fail=$(echo "$result" | grep FAILED | wc -l)
+               echo "$result"
+               if [ $fail -gt 0 ]; then
+                       echo "Found $fail Fails"
+                       echo "Remove conf file : mv $f $f.fail"
+                       mv "$f" "${f}.fail"
+                       fail_cnt=$(( ${fail_cnt} + 1 ))
+               fi
        done
+       if [ $fail_cnt -gt 0 ]; then
+               echo "Error: MIC build exits due to failed cases on dbus policy checker.(${fail_cnt} errors)"
+               exit 1
+       fi
+
 fi