f94973074b977f66a01ceff9473189d5c4061fee
[AGL/meta-agl.git] / meta-agl-security / recipes-security / security-manager / security-manager / removes-dependency-to-libslp-db-utils.patch
1 From 1e2f8f58d4320afa1d83a6f94822e53346108ee8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jos=C3=A9=20Bollo?= <jose.bollo@iot.bzh>
3 Date: Mon, 16 Nov 2015 15:56:27 +0100
4 Subject: [PATCH] removes dependency to libslp-db-utils
5
6 Change-Id: I90471e77d20e04bae58cc42eb2639e4aef97fdec
7 ---
8  src/common/CMakeLists.txt         |  1 ++-
9  src/dpl/db/src/sql_connection.cpp | 17 +----------------
10  2 files changed, 3 additions(+), 17 deletions(-)
11
12 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
13 index 968c7c1..d1fe644 100644
14 --- a/src/common/CMakeLists.txt
15 +++ b/src/common/CMakeLists.txt
16 @@ -5,7 +5,8 @@ PKG_CHECK_MODULES(COMMON_DEP
17      REQUIRED
18      libsystemd
19      libsmack
20 -    db-util
21 +    sqlite3 
22 +    icu-i18n
23      cynara-admin
24      cynara-client
25      )
26 diff --git a/src/dpl/db/src/sql_connection.cpp b/src/dpl/db/src/sql_connection.cpp
27 index fdb4fe4..1fb97be 100644
28 --- a/src/dpl/db/src/sql_connection.cpp
29 +++ b/src/dpl/db/src/sql_connection.cpp
30 @@ -26,7 +26,6 @@
31  #include <memory>
32  #include <dpl/noncopyable.h>
33  #include <dpl/assert.h>
34 -#include <db-util.h>
35  #include <unistd.h>
36  #include <cstdio>
37  #include <cstdarg>
38 @@ -606,16 +605,7 @@ void SqlConnection::Connect(const std::string &address,
39  
40      // Connect to database
41      int result;
42 -    if (type & Flag::UseLucene) {
43 -        result = db_util_open_with_options(
44 -                address.c_str(),
45 -                &m_connection,
46 -                flag,
47 -                NULL);
48 -
49 -        m_usingLucene = true;
50 -        LogPedantic("Lucene index enabled");
51 -    } else {
52 +    (void)type;
53          result = sqlite3_open_v2(
54                  address.c_str(),
55                  &m_connection,
56 @@ -624,7 +614,6 @@ void SqlConnection::Connect(const std::string &address,
57  
58          m_usingLucene = false;
59          LogPedantic("Lucene index disabled");
60 -    }
61  
62      if (result == SQLITE_OK) {
63          LogPedantic("Connected to DB");
64 @@ -653,11 +642,7 @@ void SqlConnection::Disconnect()
65  
66      int result;
67  
68 -    if (m_usingLucene) {
69 -        result = db_util_close(m_connection);
70 -    } else {
71          result = sqlite3_close(m_connection);
72 -    }
73  
74      if (result != SQLITE_OK) {
75          const char *error = sqlite3_errmsg(m_connection);
76 -- 
77 2.1.4
78