Correct the db file and text domain location 15/68215/1 accepted/tizen/ivi/20160503.094208 accepted/tizen/mobile/20160503.094117 accepted/tizen/tv/20160503.094135 accepted/tizen/wearable/20160503.094151 submit/tizen/20160503.050918
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 3 May 2016 04:57:49 +0000 (13:57 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 3 May 2016 04:57:49 +0000 (13:57 +0900)
Change-Id: I29d39432d298564fc6b263ce06a89e35fa7cb731
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-share/include/bt-share-resource.h
lib/bt-share-db.c
lib/bt-share-db.h
packaging/bluetooth-share.spec
packaging/init_db.sh

index 6fba517..9ec0788 100644 (file)
@@ -28,8 +28,8 @@ extern "C" {
 #include <tzplatform_config.h>
 
 /*==============  String ================= */
-#define BT_COMMON_PKG          "ug-bluetooth-efl"
-#define BT_COMMON_RES          "/usr/apps/ug-bluetooth-efl/shared/res/locale"
+#define BT_COMMON_PKG          "ug-setting-bluetooth-efl"
+#define BT_COMMON_RES          "/usr/ug/res/locale/"
 
 #define BT_STR_MEMORY_FULL     \
        dgettext(BT_COMMON_PKG, "IDS_BT_POP_MEMORYFULL")
index 9dc5454..d1dfc95 100644 (file)
@@ -65,6 +65,7 @@ sqlite3 *__bt_db_open(void)
        if (ret == -1 && errno == ENOENT)
        {
                DBG("DB %s doesn't exist, it needs to be created and initialized", BT_TRANSFER_DB);
+               DBG("script path: %s", SCRIPT_INIT_DB);
                ret = system(SCRIPT_INIT_DB);
                if (ret != EXIT_SUCCESS)
                        ERR("Exit code of epp not clean: %i", ret);
index f465fd3..d7190a4 100644 (file)
 extern "C" {
 #endif
 
-#define BT_TRANSFER_DB         "/opt/usr/dbspace/.bluetooth_transfer.db"
+#define BT_TRANSFER_DB         "/opt/dbspace/.bluetooth_transfer.db"
 #define BT_INBOUND_TABLE       "inbound"
 #define BT_OUTBOUND_TABLE      "outbound"
 #define BT_DB_QUERY_LEN                512
 
-#define SCRIPT_INIT_DB         tzplatform_mkpath(TZ_SYS_SHARE, "bluetooth-share/resources/init_db.sh")
+#define SCRIPT_INIT_DB         tzplatform_mkpath(TZ_USER_DATA, "bluetooth-share/init_db.sh")
 
 #define TABLE(type) ((type == BT_DB_INBOUND) ? BT_INBOUND_TABLE : BT_OUTBOUND_TABLE)
 #define TEXT(s, n) (char *)sqlite3_column_text(s, n)
index 3f4a9da..36f9901 100644 (file)
@@ -1,4 +1,4 @@
-%define TZ_SYS_SHARE /opt
+%define TZ_SYS_SHARE /opt/home/owner/data/
 
 Name:       bluetooth-share
 Summary:    Bluetooth file share Agent
@@ -81,7 +81,11 @@ make
 %make_install
 
 mkdir -p  %{buildroot}%{TZ_SYS_SHARE}/bt-ftp
-install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_SYS_SHARE}/%{name}/ressources/init_db.sh
+install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_SYS_SHARE}/%{name}/init_db.sh
+
+%post
+/sbin/ldconfig
+%{TZ_SYS_SHARE}/%{name}/init_db.sh
 
 %post -n libbluetooth-share-devel -p /sbin/ldconfig
 
index 9ffb03b..ea94c31 100644 (file)
@@ -1,10 +1,10 @@
 #!/bin/sh
 
-eval $(tzplatform-get TZ_USER_DB)
+eval $(tzplatform-get TZ_SYS_DB)
 
-if [ ! -f $TZ_USER_DB/.bluetooth_transfer.db ]
+if [ ! -f $TZ_SYS_DB/.bluetooth_transfer.db ]
 then
-       sqlite3 $TZ_USER_DB/.bluetooth_transfer.db 'PRAGMA journal_mode = PERSIST;
+       sqlite3 $TZ_SYS_DB/.bluetooth_transfer.db 'PRAGMA journal_mode = PERSIST;
         create table if not exists inbound (
                id INTEGER PRIMARY KEY autoincrement,
                sid INTEGER,
@@ -30,13 +30,13 @@ then
        '
 fi
 
-chown :$UID $TZ_USER_DB/.bluetooth_transfer.db
-chown :$UID $TZ_USER_DB/.bluetooth_transfer.db-journal
-chmod 660 $TZ_USER_DB/.bluetooth_transfer.db
-chmod 660 $TZ_USER_DB/.bluetooth_transfer.db-journal
+chown network_fw:network_fw $TZ_SYS_DB/.bluetooth_transfer.db
+chown network_fw:network_fw $TZ_SYS_DB/.bluetooth_transfer.db-journal
+chmod 664 $TZ_SYS_DB/.bluetooth_transfer.db
+chmod 664 $TZ_SYS_DB/.bluetooth_transfer.db-journal
 
 if [ -f /usr/lib/rpm-plugins/msm.so ]
 then
-       chsmack -a 'bt_share::db' $TZ_USER_DB/.bluetooth_transfer.db
-       chsmack -a 'bt_share::db' $TZ_USER_DB/.bluetooth_transfer.db-journal
+       chsmack -a '*' $TZ_SYS_DB/.bluetooth_transfer.db
+       chsmack -a '*' $TZ_SYS_DB/.bluetooth_transfer.db-journal
 fi