Change location of web-provider db and clean up C APIs
authorYunchan Cho <yunchan.cho@samsung.com>
Fri, 3 May 2013 04:27:51 +0000 (13:27 +0900)
committerGerrit Code Review <gerrit2@kim11>
Fri, 3 May 2013 11:18:44 +0000 (20:18 +0900)
[Issue#] N/A
[Problem] policy regarding location of db is changed
[Cause] N/A
[Solution] change location of db file to /opt/usr/dbspace

Change-Id: Ie8179ec237f9310c53581c2b8b20a919334e650b

data/web_provider_reset_db.sh
packaging/livebox.web-provider.spec
src/API/WebProviderDB.h
src/API/web_provider_livebox_info.cpp
src/API/web_provider_livebox_info.h

index 33a35c0..ba0553b 100644 (file)
 #    limitations under the License.
 #
 
-for name in web_provider
-do
-    rm -f /opt/dbspace/.$name.db
-    rm -f /opt/dbspace/.$name.db-journal
-    SQL="PRAGMA journal_mode = PERSIST;"
-    sqlite3 /opt/dbspace/.$name.db "$SQL"
-    SQL=".read /usr/share/web-provider/"$name"_db.sql"
-    sqlite3 /opt/dbspace/.$name.db "$SQL"
-    touch /opt/dbspace/.$name.db-journal
-    chown 0:6026 /opt/dbspace/.$name.db
-    chown 0:6026 /opt/dbspace/.$name.db-journal
-    chmod 660 /opt/dbspace/.$name.db
-    chmod 660 /opt/dbspace/.$name.db-journal
-done
+web_provider_db="/opt/usr/dbspace/.web_provider.db"
+web_provider_sql="/usr/share/web-provider/web_provider_db.sql"
+
+if [ -f $web_provider_db ]; then
+    echo "DB already exists."
+else
+    echo "create web livebox DB..."
+    rm -f $web_provider_db
+    rm -f $web_provider_db-journal
+    sql="PRAGMA journal_mode = PERSIST;"
+    sqlite3 $web_provider_db "$sql"
+    sql=".read "$web_provider_sql
+    sqlite3 $web_provider_db "$sql"
+    touch $web_provider_db-journal
+    chown 0:6026 $web_provider_db
+    chown 0:6026 $web_provider_db-journal
+    chmod 660 $web_provider_db
+    chmod 660 $web_provider_db-journal
+    echo "finish creation of db."
+fi
index 81d918d..32a54de 100755 (executable)
@@ -61,7 +61,6 @@ mkdir -p %{buildroot}%{app_data}
 
 %post
 killall -9 web-provider
-echo "create web livebox DB..."
 /usr/bin/web_provider_reset_db.sh
 if [ -f /usr/lib/rpm-plugins/msm.so ]; then
         echo "smack setting..."
index 3ba4494..e6f14f6 100644 (file)
@@ -23,7 +23,7 @@
 #include <string>
 #include "SqliteDB.h"
 
-const std::string dbPath("/opt/dbspace/.web_provider.db");
+const std::string dbPath("/opt/usr/dbspace/.web_provider.db");
 
 class WebProviderDB : public SqliteDB {
     public:
index cdddef7..77f738a 100644 (file)
@@ -231,14 +231,6 @@ int web_provider_livebox_insert_box_info(
     return 0;
 }
 
-int web_provider_livebox_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type)
-{
-    return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0, 0);
-}
-
 int web_provider_livebox_delete_by_box_id(const char* box_id)
 {
     if (!box_id) {
@@ -322,36 +314,3 @@ int web_provider_livebox_delete_by_type(const char* type)
     handle->closeDB();
     return 0;
 }
-
-const char* web_provider_info_get_default_type()
-{
-    return web_provider_livebox_get_default_type();
-}
-
-const char* web_provider_info_get_box_type(const char* box_id)
-{
-    return web_provider_livebox_get_box_type(box_id);
-}
-
-int web_provider_info_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type)
-{
-    return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0, 0);
-}
-
-int web_provider_info_delete_by_box_id(const char* box_id)
-{
-    return web_provider_livebox_delete_by_box_id(box_id);
-}
-
-int web_provider_info_delete_by_app_id(const char* app_id)
-{
-    return web_provider_livebox_delete_by_app_id(app_id);
-}
-
-int web_provider_info_delete_by_type(const char* type)
-{
-    return web_provider_livebox_delete_by_type(type);
-}
index 91951fc..4d569bd 100644 (file)
@@ -42,24 +42,10 @@ EXPORT_API int web_provider_livebox_insert_box_info(
         int auto_launch, 
         int mouse_event,
         int pd_fast_open);
-DEPRECATED_API int web_provider_livebox_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type);
 EXPORT_API int web_provider_livebox_delete_by_box_id(const char* box_id);
 EXPORT_API int web_provider_livebox_delete_by_app_id(const char* app_id);
 EXPORT_API int web_provider_livebox_delete_by_type(const char* type);
 
-DEPRECATED_API const char* web_provider_info_get_default_type();
-DEPRECATED_API const char* web_provider_info_get_box_type(const char* box_id);
-DEPRECATED_API int web_provider_info_insert_box_type(
-        const char* box_id,
-        const char* app_id,
-        const char* box_type);
-DEPRECATED_API int web_provider_info_delete_by_box_id(const char* box_id);
-DEPRECATED_API int web_provider_info_delete_by_app_id(const char* app_id);
-DEPRECATED_API int web_provider_info_delete_by_type(const char* type);
-
 #ifdef __cplusplus
 }
 #endif