From: Rafal Krypa Date: Mon, 22 Jan 2018 11:54:14 +0000 (+0100) Subject: Remove dependency on libslp-db-util X-Git-Tag: accepted/tizen/unified/20180810.062838~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F31%2F168731%2F4;p=platform%2Fcore%2Fsecurity%2Fsecurity-manager.git Remove dependency on libslp-db-util DPL class SqlConnection had some small dependency on db-util, but this code path was never used in security-manager. Remove dependency to reduce memory requirements. Change-Id: I5551f71a7f665886aa6717bb3b39f0ce8e30ffb5 Signed-off-by: Rafal Krypa --- diff --git a/packaging/security-manager.spec b/packaging/security-manager.spec index 7f92776..35d85e8 100644 --- a/packaging/security-manager.spec +++ b/packaging/security-manager.spec @@ -19,7 +19,7 @@ Requires(post): sqlite3 Requires(post): smack BuildRequires: cmake BuildRequires: zip -# BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(dlog) BuildRequires: libattr-devel BuildRequires: pkgconfig(libprocps) BuildRequires: pkgconfig(libsmack) @@ -29,7 +29,6 @@ BuildRequires: pkgconfig(libsystemd-journal) BuildRequires: pkgconfig(libtzplatform-config) BuildRequires: tizen-platform-config-tools BuildRequires: pkgconfig(sqlite3) -BuildRequires: pkgconfig(db-util) BuildRequires: pkgconfig(cynara-admin) BuildRequires: pkgconfig(cynara-client-async) BuildRequires: pkgconfig(security-privilege-manager) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 0f8f431..9a2f044 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -5,7 +5,7 @@ PKG_CHECK_MODULES(COMMON_DEP REQUIRED libsystemd libsmack - db-util + sqlite3 cynara-admin cynara-client-async libtzplatform-config diff --git a/src/dpl/db/src/sql_connection.cpp b/src/dpl/db/src/sql_connection.cpp index 0c70925..f6c5363 100644 --- a/src/dpl/db/src/sql_connection.cpp +++ b/src/dpl/db/src/sql_connection.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +//#include #include #include #include @@ -598,6 +598,7 @@ void SqlConnection::Connect(const std::string &address, // Connect to database int result; if (type & Flag::UseLucene) { +#ifdef DB_UTIL_LUCENE_INDEX result = db_util_open_with_options( address.c_str(), &m_connection, @@ -606,6 +607,10 @@ void SqlConnection::Connect(const std::string &address, m_usingLucene = true; LogDB("Lucene index enabled"); +#else + LogDB("Lucene support not compiled in!"); + Throw(Exception::InternalError); +#endif } else { result = sqlite3_open_v2( address.c_str(), @@ -644,9 +649,13 @@ void SqlConnection::Disconnect() int result; +#ifdef DB_UTIL_LUCENE_INDEX if (m_usingLucene) { result = db_util_close(m_connection); } else { +#else + { +#endif result = sqlite3_close(m_connection); } diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index edbce4a..c06fc5c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -21,7 +21,7 @@ PKG_CHECK_MODULES(COMMON_DEP REQUIRED libtzplatform-config libsystemd libsmack - db-util + sqlite3 cynara-admin cynara-client-async libtzplatform-config