Tizen 2.1 base
[platform/core/appfw/ail.git] / debian / libail-0.postinst
1 #!/bin/sh
2 CHDBGID="6010"
3
4 init_appinfo_db()
5 {
6         ail_initdb
7         if [ $? -ne 0 ]; then
8                 echo "Failed to initialize app info db"
9         fi
10 }
11
12 update_DAC_for_db_file()
13 {
14         if [ ! -f $@ ]; then
15                 touch $@
16         fi
17
18         chown :$CHDBGID $@ 2>/dev/null
19         if [ $? -ne 0 ]; then
20                 echo "Failed to change the owner of $@"
21         fi
22         chmod 664 $@ 2>/dev/null
23         if [ $? -ne 0 ]; then
24                 echo "Failed to change the perms of $@"
25         fi
26 }
27
28 init_appinfo_db
29 update_DAC_for_db_file /opt/dbspace/.app_info.db
30 update_DAC_for_db_file /opt/dbspace/.app_info.db-journal
31
32 # End of a file