Obtain TZ_BUILD_DATE in the same manner from OBS and QuickBuild
[platform/upstream/meta-generic.git] / scripts / generic-dbus-policychecker.post
1 #!/bin/sh
2 echo "#################### generic-dbus-policychecker.post ####################"
3 if [ -x /usr/bin/dbuspolicy-checker ] ; then
4         fail_cnt=0
5         for f in /etc/dbus-1/system.d/*.conf /usr/share/dbus-1/system.d/*.conf; do
6                 echo
7                 echo "$0: Checking D-Bus policy file: $f"
8                 result=$(/usr/bin/dbuspolicy-checker "$f")
9                 fail=$(echo "$result" | grep FAILED | wc -l)
10                 echo "$result"
11                 if [ $fail -gt 0 ]; then
12                         echo "Found $fail Fails"
13                         echo "Remove conf file : mv $f $f.fail"
14                         mv "$f" "${f}.fail"
15                         fail_cnt=$(( ${fail_cnt} + 1 ))
16                 fi
17         done
18         if [ $fail_cnt -gt 0 ]; then
19                 echo "Error: MIC build exits due to failed cases on dbus policy checker.(${fail_cnt} errors)"
20                 exit 1
21         fi
22
23 fi