From 2c645605f9bfce320d6c40a3d405612f53537a3a Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Wed, 14 Dec 2016 17:22:43 +0900 Subject: [PATCH] Remove storage dependency Change-Id: Ie9236da561c56c8370768b790e67d77873bf2124 Signed-off-by: Minje Ahn --- Makefile.am | 2 -- configure.ac | 5 ----- lib/media-util-noti-internal.c | 13 +++++-------- lib/media-util-noti.c | 13 +++++-------- packaging/media-server.spec | 3 +-- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Makefile.am b/Makefile.am index 57b0eb6..956b891 100644 --- a/Makefile.am +++ b/Makefile.am @@ -78,7 +78,6 @@ libmedia_utils_la_CFLAGS = -I${srcdir}/lib/include \ $(CYNARA_CLIENT_CFLAGS) \ $(CYNARA_SESSION_CFLAGS) \ $(CYNARA_CREDS_SOCKET_CFLAGS) \ - $(STORAGE_CFLAGS) \ $(SYSTEM_INFO_CFLAGS) libmedia_utils_la_LIBADD = $(GLIB_LIBS) \ @@ -93,7 +92,6 @@ libmedia_utils_la_LIBADD = $(GLIB_LIBS) \ $(CYNARA_CLIENT_LIBS) \ $(CYNARA_SESSION_LIBS) \ $(CYNARA_CREDS_SOCKET_LIBS) \ - $(STORAGE_LIBS) \ $(SYSTEM_INFO_LIBS) bin_PROGRAMS = media-server \ diff --git a/configure.ac b/configure.ac index 5b14b2c..d91a8e1 100644 --- a/configure.ac +++ b/configure.ac @@ -133,11 +133,6 @@ PKG_CHECK_MODULES(SYSTEM_INFO, capi-system-info) AC_SUBST(SYSTEM_INFO_CFLAGS) AC_SUBST(SYSTEM_INFO_LIBS) -#storage -PKG_CHECK_MODULES(STORAGE, storage) -AC_SUBST(STORAGE_CFLAGS) -AC_SUBST(STORAGE_LIBS) - dnl use notification -------------------------------------------------------------------------- AC_ARG_ENABLE(notification, AC_HELP_STRING([--enable-notification], [using notification]), [ diff --git a/lib/media-util-noti-internal.c b/lib/media-util-noti-internal.c index 512a7c7..f13f423 100755 --- a/lib/media-util-noti-internal.c +++ b/lib/media-util-noti-internal.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "media-util-internal.h" #include "media-util-dbg.h" @@ -68,6 +67,7 @@ int media_db_update_send_internal(int pid, /* mandatory */ char repl_path[MAX_FILEPATH_LEN] = {0, }; #if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH) char *tmp_path = NULL; + const char *old_path = "/opt/usr/media"; #endif bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); if (!bus) { @@ -79,14 +79,11 @@ int media_db_update_send_internal(int pid, /* mandatory */ memset(repl_path, 0, sizeof(repl_path)); #if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH) /* Need uid to change path */ - if (strncmp(path, MEDIA_ROOT_PATH_EXTERNAL, strlen(MEDIA_ROOT_PATH_EXTERNAL)) == 0) { - snprintf(repl_path, sizeof(repl_path), "%s", path); + if (strncmp(path, "/opt/usr/home", strlen("/opt/usr/home")) == 0) { + tmp_path = strstr(path, MEDIA_CONTENT_PATH); + snprintf(repl_path, sizeof(repl_path), "%s%s", old_path, tmp_path + strlen(MEDIA_CONTENT_PATH)); } else { - if (storage_get_compat_internal_path(path, MAX_FILEPATH_LEN, repl_path) != STORAGE_ERROR_NONE) { - MSAPI_DBG("Failed to change internal path..[%s] So, sending original path", path); - memset(repl_path, 0, sizeof(repl_path)); - snprintf(repl_path, sizeof(repl_path), "%s", path); - } + snprintf(repl_path, sizeof(repl_path), "%s", path); } MSAPI_DBG("New path: [%s]", repl_path); diff --git a/lib/media-util-noti.c b/lib/media-util-noti.c index 8474c78..c4a2d84 100755 --- a/lib/media-util-noti.c +++ b/lib/media-util-noti.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "media-util-internal.h" #include "media-util-dbg.h" @@ -207,6 +206,7 @@ int media_db_update_send(int pid, /* mandatory */ char repl_path[MAX_FILEPATH_LEN] = {0, }; #if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH) char *tmp_path = NULL; + const char *old_path = "/opt/usr/media"; #endif bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); @@ -219,14 +219,11 @@ int media_db_update_send(int pid, /* mandatory */ memset(repl_path, 0, sizeof(repl_path)); #if !defined(_USE_SENIOR_MODE) && !defined(_USE_TV_PATH) /* Need uid to change path */ - if (strncmp(path, MEDIA_ROOT_PATH_EXTERNAL, strlen(MEDIA_ROOT_PATH_EXTERNAL)) == 0) { - snprintf(repl_path, sizeof(repl_path), "%s", path); + if (strncmp(path, "/opt/usr/home", strlen("/opt/usr/home")) == 0) { + tmp_path = strstr(path, MEDIA_CONTENT_PATH); + snprintf(repl_path, sizeof(repl_path), "%s%s", old_path, tmp_path + strlen(MEDIA_CONTENT_PATH)); } else { - if (storage_get_compat_internal_path(path, MAX_FILEPATH_LEN, repl_path) != STORAGE_ERROR_NONE) { - MSAPI_DBG("Failed to change internal path..[%s] So, sending original path", path); - memset(repl_path, 0, sizeof(repl_path)); - snprintf(repl_path, sizeof(repl_path), "%s", path); - } + snprintf(repl_path, sizeof(repl_path), "%s", path); } MSAPI_DBG("New path: [%s]", repl_path); diff --git a/packaging/media-server.spec b/packaging/media-server.spec index fcc74e2..4238ee2 100755 --- a/packaging/media-server.spec +++ b/packaging/media-server.spec @@ -1,6 +1,6 @@ Name: media-server Summary: A server for media content management -Version: 0.3.24 +Version: 0.3.25 Release: 0 Group: Multimedia/Service License: Apache-2.0 @@ -30,7 +30,6 @@ BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: pkgconfig(cynara-client) BuildRequires: pkgconfig(cynara-session) BuildRequires: pkgconfig(capi-system-info) -BuildRequires: pkgconfig(storage) BuildRequires: gettext-tools %if 0%{?TIZEN_PRODUCT_TV} -- 2.7.4