Add rua stat db upgrade logic to upgrade script 98/91698/8
authorHyunho Kang <hhstark.kang@samsung.com>
Tue, 11 Oct 2016 01:56:56 +0000 (10:56 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 12 Oct 2016 00:37:57 +0000 (17:37 -0700)
Change-Id: Ic221fbd6e4f478f4d517517c2a426a82f7f47d63
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
scripts/103.rua_upgrade.sh

index 424b6a44e69cbe9f471a9b46882feb8bd7bcc81c..6e401ee7c81a164aada34949f7eff68a9861180c 100755 (executable)
@@ -9,8 +9,24 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
 DB_DIR=/opt/dbspace
 DB_RUA=$DB_DIR/.rua.db
+DB_RUA_STAT=$DB_DIR/.rua_stat.db
+
+USR_DB_DIR=/opt/usr/home/owner/.applications/dbspace
+UPGRADE_DB_RUA_STAT=$USR_DB_DIR/.rua_stat.db
 
 # Delete DB & DB journal
 rm -rf $DB_RUA
 rm -rf $DB_RUA-journal
 
+# Copy stat DB & DB journal
+cp -rf $DB_RUA_STAT $USR_DB_DIR
+cp -rf $DB_RUA_STAT-journal $USR_DB_DIR
+
+rm -rf $DB_RUA_STAT
+rm -rf $DB_RUA_STAT-journal
+
+chmod 644 $UPGRADE_DB_RUA_STAT
+chmod 644 $UPGRADE_DB_RUA_STAT-journal
+
+chsmack -a User::Home $UPGRADE_DB_RUA_STAT
+chsmack -a User::Home $UPGRADE_DB_RUA_STAT-journal
\ No newline at end of file