Remove db-util package dependency 94/197194/1
authorjiyong.min <jiyong.min@samsung.com>
Mon, 3 Dec 2018 02:53:14 +0000 (11:53 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 10 Jan 2019 07:28:34 +0000 (16:28 +0900)
Change-Id: I07ebd41dfb997680b27515f2725a36858a01e06d

CMakeLists.txt
packaging/capi-media-controller.spec
src/media_controller_db.c
svc/CMakeLists.txt
svc/media_controller_db_util.c

index 72fb55f6de5891ae96f912f32db6ffe134dfd595..46cc0bab486d308f89a080443d6e94be3803d758 100755 (executable)
@@ -26,7 +26,7 @@ SET(submodule "controller")
 SET(fw_name "${project_prefix}-${service}-${submodule}")
 
 # for package file
-SET(dependents "capi-base-common glib-2.0 gio-2.0 dlog sqlite3 db-util aul bundle libtzplatform-config cynara-client cynara-session cynara-creds-socket uuid")
+SET(dependents "capi-base-common glib-2.0 gio-2.0 dlog sqlite3 aul bundle libtzplatform-config cynara-client cynara-session cynara-creds-socket uuid")
 SET(pc_dependents "capi-base-common")
 
 PROJECT(${fw_name})
index 10c2dfbf5a9854d155b75541c461bfaf3d2bdcad..e2c181a7d5ff9a029f65c7a9721aab28e4870357 100644 (file)
@@ -13,7 +13,6 @@ BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(sqlite3)
-BuildRequires:  pkgconfig(db-util)
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(bundle)
 BuildRequires:  pkgconfig(libsystemd-daemon)
index 42dc576600283347b24e45a5b25083060d9b0210..987cf50c9ff4b758743222f631e891cc519c4f57 100755 (executable)
@@ -21,7 +21,6 @@
 #include <pwd.h>
 #include <stdio.h>
 #include <tzplatform_config.h>
-#include <db-util.h>
 
 #include "media_controller_private.h"
 #include "media_controller_db.h"
@@ -235,7 +234,7 @@ int mc_db_connect(void **handle)
        db_name = __mc_get_db_name(getuid());
        mc_retvm_if(db_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "error __mc_get_db_name");
 
-       ret = db_util_open_with_options(db_name, &db_handle, SQLITE_OPEN_READONLY, NULL);
+       ret = sqlite3_open_v2(db_name, &db_handle, SQLITE_OPEN_READONLY, NULL);
        if (SQLITE_OK != ret) {
                mc_error("error when db open [%s]", db_name);
                *handle = NULL;
@@ -252,7 +251,7 @@ int mc_db_connect(void **handle)
        ret = sqlite3_busy_handler(db_handle, __mc_db_busy_handler, NULL);
        if (SQLITE_OK != ret) {
                mc_error("error when register busy handler %s", sqlite3_errmsg(db_handle));
-               db_util_close(db_handle);
+               sqlite3_close_v2(db_handle);
                *handle = NULL;
 
                return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
@@ -924,7 +923,7 @@ int mc_db_disconnect(void *handle)
 
        mc_retvm_if(db_handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
 
-       ret = db_util_close(db_handle);
+       ret = sqlite3_close_v2(db_handle);
        if (SQLITE_OK != ret) {
                mc_error("error when db close");
                mc_error("Error : %s", sqlite3_errmsg(db_handle));
index 7753bc86bf3efd3510988a0030e62545fb126856..d6d2728b02778f774e114ba34c7b6b6a9933c998 100755 (executable)
@@ -1,5 +1,5 @@
 # for package file
-SET(dependents "capi-base-common glib-2.0 gio-2.0 dlog sqlite3 db-util libsystemd-daemon libsystemd-login libtzplatform-config cynara-client cynara-session cynara-creds-socket")
+SET(dependents "capi-base-common glib-2.0 gio-2.0 dlog sqlite3 libsystemd-daemon libsystemd-login libtzplatform-config cynara-client cynara-session cynara-creds-socket")
 SET(fw_svc "media-controller-svc")
 
 PROJECT(${fw_svc})
index 88d263609118d0ad17c34ba68fe133c9ad508b12..0ff0736fc16fc1804f96e6160566d892da242cc7 100644 (file)
 * limitations under the License.
 */
 #include <unistd.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <grp.h>
 #include <pwd.h>
 #include <sqlite3.h>
 #include <tzplatform_config.h>
-#include <db-util.h>
 #include <gio/gio.h>
 
 #include "media_controller_private.h"
@@ -270,7 +270,7 @@ int mc_db_util_connect(void **handle, uid_t uid)
        }
 
        /*Connect DB*/
-       ret = db_util_open_with_options(db_name, &db_handle, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
+       ret = sqlite3_open_v2(db_name, &db_handle, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
 
        MC_SAFE_FREE(db_name);
 
@@ -288,7 +288,7 @@ int mc_db_util_connect(void **handle, uid_t uid)
        ret = sqlite3_busy_handler(db_handle, __mc_db_util_busy_handler, NULL);
        if (SQLITE_OK != ret) {
                mc_error("error when register busy handler %s", sqlite3_errmsg(db_handle));
-               db_util_close(db_handle);
+               sqlite3_close_v2(db_handle);
                return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
        }
 
@@ -304,7 +304,7 @@ int mc_db_util_connect(void **handle, uid_t uid)
                if (*handle)
                        mc_error("[error when change the journal mode] %s", sqlite3_errmsg(*handle));
 
-               db_util_close(*handle);
+               sqlite3_close_v2(*handle);
                *handle = NULL;
 
                return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
@@ -320,7 +320,7 @@ int mc_db_util_disconnect(void *handle)
 
        mc_retvm_if(db_handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
 
-       ret = db_util_close(db_handle);
+       ret = sqlite3_close_v2(db_handle);
        if (SQLITE_OK != ret) {
                mc_error("error when db close");
                mc_error("Error : %s", sqlite3_errmsg(db_handle));