Remove pkgmgrinfo_private from pkgmgr-info
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 4 Feb 2021 06:40:06 +0000 (15:40 +0900)
committer연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Thu, 4 Feb 2021 09:35:21 +0000 (18:35 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
26 files changed:
src/common/database/appinfo_db_handler.hh
src/common/database/cache_db_handler.hh
src/common/database/cert_get_db_handler.hh
src/common/database/cert_set_db_handler.hh
src/common/database/pkg_get_db_handler.hh
src/common/database/pkg_set_db_handler.hh
src/common/database/query_handler.hh
src/common/parcel/appctrlprivinfo_parcel.cc
src/common/parcel/appctrlprivinfo_parcel.hh
src/common/parcel/appinfo_parcel.cc
src/common/parcel/appinfo_parcel.hh
src/common/parcel/certinfo_parcel.cc
src/common/parcel/certinfo_parcel.hh
src/common/parcel/datactrlinfo_parcel.cc
src/common/parcel/datactrlinfo_parcel.hh
src/common/parcel/filter_parcel.cc
src/common/parcel/filter_parcel.hh
src/common/parcel/pkginfo_parcel.cc
src/common/parcel/pkginfo_parcel.hh
src/common/parcel/string_parcel.cc
src/common/parcel/string_parcel.hh
src/common/pkgmgrinfo_private.c
src/pkgmgrinfo_debug.h [deleted file]
src/pkgmgrinfo_private.c [deleted file]
src/pkgmgrinfo_private.h [deleted file]
tool/CMakeLists.txt

index 4a4294b..6267f29 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index c6d14b3..b662bc1 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index 93fc467..1ca776f 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index 3edb0de..9df9617 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index ff297f8..083a0b2 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index 5bf9a41..9bd90d5 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index 254ffdd..11ba1d6 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "abstract_db_handler.hh"
 #include "pkgmgrinfo_basic.h"
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 
index a99e3ee..6a9099c 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 4850f76..e281bf8 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index ae82185..9eee59f 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 72ba314..7865eb8 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index b6fa6b1..55f9c03 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 688e347..ea06358 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 91ecc72..ca7432a 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index a16c0ba..873fd3c 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 87125de..bdc71af 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 553bada..274d6de 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 0d9f8be..e0540ae 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 2e53ff9..5629230 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 6acd45b..d4c0e6d 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 80d372d..6055d8a 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <vector>
 
-#include "../../src/pkgmgrinfo_private.h"
+#include "pkgmgrinfo_private.h"
 
 namespace pkgmgr_common {
 namespace parcel {
index 68f6f36..2c85c4d 100644 (file)
@@ -132,7 +132,7 @@ static struct _appinfo_bool_map_t appinfo_bool_prop_map[] = {
        {E_PMINFO_APPINFO_PROP_PKG_DISABLE,             PMINFO_APPINFO_PROP_PKG_DISABLE}
 };
 
-inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
+API pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
 {
        int i = 0;
        int max = 0;
@@ -150,7 +150,7 @@ inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(co
        return prop;
 }
 
-inline pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property)
+API pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property)
 {
        int i = 0;
        int max = 0;
@@ -168,7 +168,7 @@ inline pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(co
        return prop;
 }
 
-inline pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property)
+API pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property)
 {
        int i = 0;
        int max = 0;
@@ -186,7 +186,7 @@ inline pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(
        return prop;
 }
 
-inline pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property)
+API pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property)
 {
        int i = 0;
        int max = 0;
@@ -204,7 +204,7 @@ inline pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(co
        return prop;
 }
 
-inline pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property)
+API pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property)
 {
        int i = 0;
        int max = 0;
@@ -222,7 +222,7 @@ inline pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(co
        return prop;
 }
 
-inline pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property)
+API pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property)
 {
        int i = 0;
        int max = 0;
@@ -240,7 +240,7 @@ inline pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(
        return prop;
 }
 
-int __get_filter_condition(gpointer data, uid_t uid, char **condition, GList **params)
+API int __get_filter_condition(gpointer data, uid_t uid, char **condition, GList **params)
 {
        pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)data;
        char buf[MAX_QUERY_LEN] = {'\0'};
@@ -432,7 +432,7 @@ int __get_filter_condition(gpointer data, uid_t uid, char **condition, GList **p
        return flag;
 }
 
-int __get_metadata_filter_condition(gpointer data, char **condition,
+API int __get_metadata_filter_condition(gpointer data, char **condition,
                GList **params)
 {
        pkgmgrinfo_metadata_node_x *node = (pkgmgrinfo_metadata_node_x *)data;
@@ -452,7 +452,7 @@ int __get_metadata_filter_condition(gpointer data, char **condition,
        return E_PMINFO_APPINFO_JOIN_METADATA;
 }
 
-int _add_icon_info_into_list(const char *locale, char *value, GList **icon)
+API int _add_icon_info_into_list(const char *locale, char *value, GList **icon)
 {
        icon_x *info;
 
@@ -468,7 +468,7 @@ int _add_icon_info_into_list(const char *locale, char *value, GList **icon)
        return PMINFO_R_OK;
 }
 
-int _add_label_info_into_list(const char *locale, char *value, GList **label)
+API int _add_label_info_into_list(const char *locale, char *value, GList **label)
 {
        label_x *info;
 
@@ -484,7 +484,7 @@ int _add_label_info_into_list(const char *locale, char *value, GList **label)
        return PMINFO_R_OK;
 }
 
-char *_get_system_locale(void)
+API char *_get_system_locale(void)
 {
        char *lang;
        char *locale;
@@ -517,7 +517,7 @@ char *_get_system_locale(void)
        return locale;
 }
 
-int __pkginfo_check_installed_storage(package_x *pkginfo)
+API int __pkginfo_check_installed_storage(package_x *pkginfo)
 {
        char buf[MAX_QUERY_LEN] = {'\0'};
        int ret;
@@ -538,7 +538,7 @@ int __pkginfo_check_installed_storage(package_x *pkginfo)
        return PMINFO_R_OK;
 }
 
-int __appinfo_check_installed_storage(application_x *appinfo)
+API int __appinfo_check_installed_storage(application_x *appinfo)
 {
        retvm_if(appinfo->installed_storage == NULL, PMINFO_R_ERROR,
                        "installed_storage is NULL\n");
@@ -568,7 +568,7 @@ static int __db_busy_handler(void *data, int count)
        }
 }
 
-int __open_db(const char *path, sqlite3 **db, int flags)
+API int __open_db(const char *path, sqlite3 **db, int flags)
 {
        int ret;
 
@@ -601,7 +601,7 @@ struct type_map type_map[] = {
        { NULL, NULL}
 };
 
-char *__get_type_from_path(const char *pkg_path)
+API char *__get_type_from_path(const char *pkg_path)
 {
        const char *type = NULL;
        unzFile uf;
@@ -643,7 +643,7 @@ static const char *__get_library_path(const char *pkg_type)
        return path;
 }
 
-pkg_plugin_set *__load_library(const char *pkg_type)
+API pkg_plugin_set *__load_library(const char *pkg_type)
 {
        void *library_handle;
        pkg_plugin_set *plugin_set;
@@ -711,7 +711,7 @@ pkg_plugin_set *__load_library(const char *pkg_type)
        return plugin_set;
 }
 
-void __unload_library(const char *pkg_type)
+API void __unload_library(const char *pkg_type)
 {
        pkg_plugin_set *plugin_set;
 
diff --git a/src/pkgmgrinfo_debug.h b/src/pkgmgrinfo_debug.h
deleted file mode 100644 (file)
index 3f24c3a..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * pkgmgrinfo_debug
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
-  * Contact: junsuk. oh <junsuk77.oh@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __PKGMGR_INFO_DEBUG_H__
-#define __PKGMGR_INFO_DEBUG_H__
-
-#include <dlog.h>
-
-#define _LOGE(fmt, arg...) LOGE(fmt, ##arg)
-#define _LOGI(fmt, arg...) LOGI(fmt, ##arg)
-#define _LOGD(fmt, arg...) LOGD(fmt, ##arg)
-
-#define PKGMGR_INFO_ENABLE_DLOG
-
-#define COLOR_RED              "\033[0;31m"
-#define COLOR_BLUE             "\033[0;34m"
-#define COLOR_END              "\033[0;m"
-
-#ifdef PKGMGR_INFO_ENABLE_DLOG
-#define PKGMGR_INFO_DEBUG(fmt, ...) \
-       do { \
-               LOGD(fmt, ##__VA_ARGS__); \
-       } while (0)
-
-#define PKGMGR_INFO_DEBUG_ERR(fmt, ...) \
-       do { \
-               LOGE(COLOR_RED fmt COLOR_END, ##__VA_ARGS__); \
-       } while (0)
-
-#define PKGMGR_INFO_BEGIN() \
-       do { \
-               LOGD(COLOR_BLUE"BEGIN >>>>"COLOR_END); \
-       } while (0)
-
-#define PKGMGR_INFO_END() \
-       do { \
-               LOGD(COLOR_BLUE"END <<<<"COLOR_END); \
-       } while (0)
-
-#else
-#define PKGMGR_INFO_DEBUG(fmt, ...) \
-       do { \
-               printf("\n [%s: %s(): %d] " fmt"\n",  rindex(__FILE__, '/')+1, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
-       } while (0)
-
-#define PKGMGR_INFO_BEGIN() \
-       do { \
-               printf("\n [%s: %d] : BEGIN >>>> %s() \n", rindex(__FILE__, '/')+1,  __LINE__ , __FUNCTION__); \
-       } while (0)
-
-#define PKGMGR_INFO_END() \
-       do { \
-               printf("\n [%s: %d]: END   <<<< %s()\n", rindex(__FILE__, '/')+1,  __LINE__ , __FUNCTION__); \
-       } while (0)
-#endif
-
-
-#define ret_if(expr) do { \
-       if (expr) { \
-               PKGMGR_INFO_DEBUG_ERR("(%s) ", #expr); \
-               return; \
-       } \
-} while (0)
-
-#define retm_if(expr, fmt, arg...) do { \
-       if (expr) { \
-               PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
-               return; \
-       } \
-} while (0)
-
-#define retv_if(expr, val) do { \
-       if (expr) { \
-               PKGMGR_INFO_DEBUG_ERR("(%s) ", #expr); \
-               return (val); \
-       } \
-} while (0)
-
-#define retvm_if(expr, val, fmt, arg...) do { \
-       if (expr) { \
-               PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
-               return (val); \
-       } \
-} while (0)
-
-#define trym_if(expr, fmt, arg...) do { \
-       if (expr) { \
-               PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
-               goto catch; \
-       } \
-} while (0)
-
-#define tryvm_if(expr, val, fmt, arg...) do { \
-       if (expr) { \
-               PKGMGR_INFO_DEBUG_ERR("(%s) "fmt, #expr, ##arg); \
-               val; \
-               goto catch; \
-       } \
-} while (0)
-
-#endif  /* __PKGMGR_INFO_DEBUG_H__ */
diff --git a/src/pkgmgrinfo_private.c b/src/pkgmgrinfo_private.c
deleted file mode 100644 (file)
index 68f6f36..0000000
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
- * pkgmgr-info
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
- * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <dlfcn.h>
-
-#include <vconf.h>
-#include <sqlite3.h>
-#include <glib.h>
-#include <unzip.h>
-
-#include "pkgmgr-info.h"
-#include "pkgmgrinfo_debug.h"
-#include "pkgmgrinfo_private.h"
-#include "pkgmgr_parser.h"
-
-static GHashTable *plugin_set_list;
-
-struct _pkginfo_str_map_t {
-       pkgmgrinfo_pkginfo_filter_prop_str prop;
-       const char *property;
-};
-
-static struct _pkginfo_str_map_t pkginfo_str_prop_map[] = {
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_ID,      PMINFO_PKGINFO_PROP_PACKAGE_ID},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE,    PMINFO_PKGINFO_PROP_PACKAGE_TYPE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION, PMINFO_PKGINFO_PROP_PACKAGE_VERSION},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,        PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,       PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,    PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE,       PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE}
-};
-
-struct _pkginfo_int_map_t {
-       pkgmgrinfo_pkginfo_filter_prop_int prop;
-       const char *property;
-};
-
-static struct _pkginfo_int_map_t pkginfo_int_prop_map[] = {
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE,    PMINFO_PKGINFO_PROP_PACKAGE_SIZE}
-};
-
-struct _pkginfo_bool_map_t {
-       pkgmgrinfo_pkginfo_filter_prop_bool prop;
-       const char *property;
-};
-
-static struct _pkginfo_bool_map_t pkginfo_bool_prop_map[] = {
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE,       PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD,         PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY,        PMINFO_PKGINFO_PROP_PACKAGE_READONLY},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE,          PMINFO_PKGINFO_PROP_PACKAGE_UPDATE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING,      PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING,       PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE, PMINFO_PKGINFO_PROP_PACKAGE_DISABLE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE,   PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM,          PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM}
-};
-
-struct _appinfo_str_map_t {
-       pkgmgrinfo_appinfo_filter_prop_str prop;
-       const char *property;
-};
-
-static struct _appinfo_str_map_t appinfo_str_prop_map[] = {
-       {E_PMINFO_APPINFO_PROP_APP_ID,          PMINFO_APPINFO_PROP_APP_ID},
-       {E_PMINFO_APPINFO_PROP_APP_COMPONENT,   PMINFO_APPINFO_PROP_APP_COMPONENT},
-       {E_PMINFO_APPINFO_PROP_APP_EXEC,        PMINFO_APPINFO_PROP_APP_EXEC},
-       {E_PMINFO_APPINFO_PROP_APP_ICON,        PMINFO_APPINFO_PROP_APP_ICON},
-       {E_PMINFO_APPINFO_PROP_APP_TYPE,        PMINFO_APPINFO_PROP_APP_TYPE},
-       {E_PMINFO_APPINFO_PROP_APP_OPERATION,   PMINFO_APPINFO_PROP_APP_OPERATION},
-       {E_PMINFO_APPINFO_PROP_APP_URI, PMINFO_APPINFO_PROP_APP_URI},
-       {E_PMINFO_APPINFO_PROP_APP_MIME,        PMINFO_APPINFO_PROP_APP_MIME},
-       {E_PMINFO_APPINFO_PROP_APP_CATEGORY,    PMINFO_APPINFO_PROP_APP_CATEGORY},
-       {E_PMINFO_APPINFO_PROP_APP_HWACCELERATION,      PMINFO_APPINFO_PROP_APP_HWACCELERATION},
-       {E_PMINFO_APPINFO_PROP_APP_SCREENREADER,        PMINFO_APPINFO_PROP_APP_SCREENREADER},
-       {E_PMINFO_APPINFO_PROP_APP_PACKAGE,     PMINFO_APPINFO_PROP_APP_PACKAGE},
-       {E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE,   PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE},
-       {E_PMINFO_APPINFO_PROP_PRIVILEGE,       PMINFO_APPINFO_PROP_PRIVILEGE}
-};
-
-struct _appinfo_int_map_t {
-       pkgmgrinfo_appinfo_filter_prop_int prop;
-       const char *property;
-};
-
-static struct _appinfo_int_map_t appinfo_int_prop_map[] = {
-       {E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE,        PMINFO_APPINFO_PROP_APP_SUPPORT_MODE}
-};
-
-struct _appinfo_bool_map_t {
-       pkgmgrinfo_appinfo_filter_prop_bool prop;
-       const char *property;
-};
-
-static struct _appinfo_bool_map_t appinfo_bool_prop_map[] = {
-       {E_PMINFO_APPINFO_PROP_APP_NODISPLAY,           PMINFO_APPINFO_PROP_APP_NODISPLAY},
-       {E_PMINFO_APPINFO_PROP_APP_MULTIPLE,            PMINFO_APPINFO_PROP_APP_MULTIPLE},
-       {E_PMINFO_APPINFO_PROP_APP_ONBOOT,              PMINFO_APPINFO_PROP_APP_ONBOOT},
-       {E_PMINFO_APPINFO_PROP_APP_AUTORESTART,         PMINFO_APPINFO_PROP_APP_AUTORESTART},
-       {E_PMINFO_APPINFO_PROP_APP_TASKMANAGE,          PMINFO_APPINFO_PROP_APP_TASKMANAGE},
-       {E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION,             PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION},
-       {E_PMINFO_APPINFO_PROP_APP_UI_GADGET,           PMINFO_APPINFO_PROP_APP_UI_GADGET},
-       {E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE,             PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE},
-       {E_PMINFO_APPINFO_PROP_APP_DISABLE,             PMINFO_APPINFO_PROP_APP_DISABLE},
-       {E_PMINFO_APPINFO_PROP_APP_CHECK_STORAGE,               PMINFO_APPINFO_PROP_APP_CHECK_STORAGE},
-       {E_PMINFO_APPINFO_PROP_PKG_DISABLE,             PMINFO_APPINFO_PROP_PKG_DISABLE}
-};
-
-inline pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property)
-{
-       int i = 0;
-       int max = 0;
-       pkgmgrinfo_pkginfo_filter_prop_str prop = -1;
-
-       if (property == NULL)
-               return -1;
-       max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR + 1;
-       for (i = 0 ; i < max; i++) {
-               if (strcmp(property, pkginfo_str_prop_map[i].property) == 0) {
-                       prop =  pkginfo_str_prop_map[i].prop;
-                       break;
-               }
-       }
-       return prop;
-}
-
-inline pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property)
-{
-       int i = 0;
-       int max = 0;
-       pkgmgrinfo_pkginfo_filter_prop_int prop = -1;
-
-       if (property == NULL)
-               return -1;
-       max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_INT - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT + 1;
-       for (i = 0 ; i < max; i++) {
-               if (strcmp(property, pkginfo_int_prop_map[i].property) == 0) {
-                       prop =  pkginfo_int_prop_map[i].prop;
-                       break;
-               }
-       }
-       return prop;
-}
-
-inline pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property)
-{
-       int i = 0;
-       int max = 0;
-       pkgmgrinfo_pkginfo_filter_prop_bool prop = -1;
-
-       if (property == NULL)
-               return -1;
-       max = E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL - E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL + 1;
-       for (i = 0 ; i < max; i++) {
-               if (strcmp(property, pkginfo_bool_prop_map[i].property) == 0) {
-                       prop =  pkginfo_bool_prop_map[i].prop;
-                       break;
-               }
-       }
-       return prop;
-}
-
-inline pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property)
-{
-       int i = 0;
-       int max = 0;
-       pkgmgrinfo_appinfo_filter_prop_str prop = -1;
-
-       if (property == NULL)
-               return -1;
-       max = E_PMINFO_APPINFO_PROP_APP_MAX_STR - E_PMINFO_APPINFO_PROP_APP_MIN_STR + 1;
-       for (i = 0 ; i < max; i++) {
-               if (strcmp(property, appinfo_str_prop_map[i].property) == 0) {
-                       prop =  appinfo_str_prop_map[i].prop;
-                       break;
-               }
-       }
-       return prop;
-}
-
-inline pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property)
-{
-       int i = 0;
-       int max = 0;
-       pkgmgrinfo_appinfo_filter_prop_int prop = -1;
-
-       if (property == NULL)
-               return -1;
-       max = E_PMINFO_APPINFO_PROP_APP_MAX_INT - E_PMINFO_APPINFO_PROP_APP_MIN_INT + 1;
-       for (i = 0 ; i < max; i++) {
-               if (strcmp(property, appinfo_int_prop_map[i].property) == 0) {
-                       prop =  appinfo_int_prop_map[i].prop;
-                       break;
-               }
-       }
-       return prop;
-}
-
-inline pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property)
-{
-       int i = 0;
-       int max = 0;
-       pkgmgrinfo_appinfo_filter_prop_bool prop = -1;
-
-       if (property == NULL)
-               return -1;
-       max = E_PMINFO_APPINFO_PROP_APP_MAX_BOOL - E_PMINFO_APPINFO_PROP_APP_MIN_BOOL + 1;
-       for (i = 0 ; i < max; i++) {
-               if (strcmp(property, appinfo_bool_prop_map[i].property) == 0) {
-                       prop =  appinfo_bool_prop_map[i].prop;
-                       break;
-               }
-       }
-       return prop;
-}
-
-int __get_filter_condition(gpointer data, uid_t uid, char **condition, GList **params)
-{
-       pkgmgrinfo_node_x *node = (pkgmgrinfo_node_x *)data;
-       char buf[MAX_QUERY_LEN] = {'\0'};
-       int flag = 0;
-       char *value;
-       char *ptr = NULL;
-       char *saveptr = NULL;
-
-       switch (node->prop) {
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_ID:
-               snprintf(buf, sizeof(buf), "pi.package=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE:
-               snprintf(buf, sizeof(buf), "pi.package_type=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION:
-               snprintf(buf, sizeof(buf), "pi.package_version=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION:
-               snprintf(buf, sizeof(buf), "pi.install_location=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE:
-               snprintf(buf, sizeof(buf), "pi.installed_storage=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME:
-               snprintf(buf, sizeof(buf), "pi.author_name=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF:
-               snprintf(buf, sizeof(buf), "pi.author_href=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL:
-               snprintf(buf, sizeof(buf), "pi.author_email=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE:
-               snprintf(buf, sizeof(buf), "package_privilege_info.privilege=?");
-               flag = E_PMINFO_PKGINFO_JOIN_PRIVILEGE_INFO;
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE:
-               snprintf(buf, sizeof(buf), "pi.package_size=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE:
-               snprintf(buf, sizeof(buf), "pi.package_removable=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD:
-               snprintf(buf, sizeof(buf), "pi.package_preload=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY:
-               snprintf(buf, sizeof(buf), "pi.package_readonly=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE:
-               snprintf(buf, sizeof(buf), "pi.package_update=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING:
-               snprintf(buf, sizeof(buf), "pi.package_appsetting=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING:
-               snprintf(buf, sizeof(buf), "pi.package_nodisplay=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE:
-               snprintf(buf, sizeof(buf), "pi.package_support_disable=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE:
-               snprintf(buf, sizeof(buf), "pi.package_disable=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM:
-               snprintf(buf, sizeof(buf), "pi.package_system=? COLLATE NOCASE");
-               break;
-
-       case E_PMINFO_APPINFO_PROP_APP_ID:
-               snprintf(buf, sizeof(buf), "ai.app_id=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_COMPONENT:
-               snprintf(buf, sizeof(buf), "ai.app_component=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_EXEC:
-               snprintf(buf, sizeof(buf), "ai.app_exec=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_ICON:
-               snprintf(buf, sizeof(buf), "package_app_localized_info.app_icon=?");
-               flag = E_PMINFO_APPINFO_JOIN_LOCALIZED_INFO;
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_TYPE:
-               snprintf(buf, sizeof(buf), "ai.app_type=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_OPERATION:
-               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE ?||'|%%%%|%%%%'");
-               flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_URI:
-               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|'||?||'|%%%%'");
-               flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_MIME:
-               snprintf(buf, sizeof(buf), "package_app_app_control.app_control LIKE '%%%%|%%%%|'||?");
-               flag = E_PMINFO_APPINFO_JOIN_APP_CONTROL;
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_CATEGORY:
-               snprintf(buf, sizeof(buf), "package_app_app_category.category IN (");
-               value = strdup(node->value);
-               if (value == NULL) {
-                       _LOGE("out of memeory");
-                       return 0;
-               }
-               ptr = strtok_r(value, ",", &saveptr);
-               if (ptr == NULL) {
-                       free(value);
-                       return 0;
-               }
-               strncat(buf, "?", sizeof(buf) - strlen(buf) - 1);
-               *params = g_list_append(*params, strdup(ptr));
-               while ((ptr = strtok_r(NULL, ",", &saveptr))) {
-                       strncat(buf, ", ?", sizeof(buf) - strlen(buf) - 1);
-                       *params = g_list_append(*params, strdup(ptr));
-               }
-               strncat(buf, ")", sizeof(buf) - strlen(buf) - 1);
-               *condition = strdup(buf);
-               flag = E_PMINFO_APPINFO_JOIN_CATEGORY;
-               free(value);
-
-               return flag;
-       case E_PMINFO_APPINFO_PROP_APP_NODISPLAY:
-               snprintf(buf, sizeof(buf), "ai.app_nodisplay=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_MULTIPLE:
-               snprintf(buf, sizeof(buf), "ai.app_multiple=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_ONBOOT:
-               snprintf(buf, sizeof(buf), "ai.app_onboot=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_AUTORESTART:
-               snprintf(buf, sizeof(buf), "ai.app_autorestart=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_TASKMANAGE:
-               snprintf(buf, sizeof(buf), "ai.app_taskmanage=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_HWACCELERATION:
-               snprintf(buf, sizeof(buf), "ai.app_hwacceleration=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_SCREENREADER:
-               snprintf(buf, sizeof(buf), "ai.app_screenreader=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION:
-               snprintf(buf, sizeof(buf), "ai.app_launchcondition=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_PACKAGE:
-               snprintf(buf, sizeof(buf), "ai.package=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE:
-               snprintf(buf, sizeof(buf), "ai.app_installed_storage=?");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_UI_GADGET:
-               snprintf(buf, sizeof(buf), "ai.app_ui_gadget=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_DISABLE:
-               if (strcasecmp(node->value, "true") == 0)
-                       snprintf(buf, MAX_QUERY_LEN, "(ai.app_disable=? COLLATE NOCASE " \
-                                       "OR ui.is_disabled='true' COLLATE NOCASE)");
-               else
-                       snprintf(buf, MAX_QUERY_LEN, "(ai.app_disable=? COLLATE NOCASE " \
-                                       "AND (ui.is_disabled='false' COLLATE NOCASE " \
-                                       "OR ui.is_disabled IS NULL))");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE:
-               snprintf(buf, MAX_QUERY_LEN, "ai.app_support_disable=? COLLATE NOCASE");
-               break;
-       case E_PMINFO_APPINFO_PROP_PKG_DISABLE:
-               snprintf(buf, MAX_QUERY_LEN,
-                               "ai.package IN (SELECT package FROM " \
-                               "package_info WHERE package_disable=?)");
-               break;
-       case E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE:
-               snprintf(buf, sizeof(buf), "ai.app_support_mode=?");
-               break;
-       case E_PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE:
-       case E_PMINFO_APPINFO_PROP_APP_CHECK_STORAGE:
-               *condition = NULL;
-               return 0;
-       case E_PMINFO_APPINFO_PROP_PRIVILEGE:
-               snprintf(buf, sizeof(buf), "package_privilege_info.privilege=?");
-               flag = E_PMINFO_APPINFO_JOIN_PRIVILEGE;
-               break;
-       default:
-               _LOGE("Invalid Property Type\n");
-               *condition = NULL;
-               return 0;
-       }
-       *condition = strdup(buf);
-       *params = g_list_append(*params, strdup(node->value));
-       return flag;
-}
-
-int __get_metadata_filter_condition(gpointer data, char **condition,
-               GList **params)
-{
-       pkgmgrinfo_metadata_node_x *node = (pkgmgrinfo_metadata_node_x *)data;
-       char buf[MAX_QUERY_LEN];
-
-       snprintf(buf, sizeof(buf), "(package_app_app_metadata.md_key=?");
-       if (node->value)
-               strncat(buf, " AND package_app_app_metadata.md_value=?",
-                               sizeof(buf) - strlen(buf) - 1);
-       strncat(buf, ")", sizeof(buf) - strlen(buf) - 1);
-
-       *condition = strdup(buf);
-       *params = g_list_append(*params, strdup(node->key));
-       if (node->value)
-               *params = g_list_append(*params, strdup(node->value));
-
-       return E_PMINFO_APPINFO_JOIN_METADATA;
-}
-
-int _add_icon_info_into_list(const char *locale, char *value, GList **icon)
-{
-       icon_x *info;
-
-       info = calloc(1, sizeof(icon_x));
-       if (info == NULL) {
-               LOGE("out of memory");
-               return PMINFO_R_ERROR;
-       }
-       info->text = value;
-       info->lang = strdup(locale);
-       *icon = g_list_prepend(*icon, info);
-
-       return PMINFO_R_OK;
-}
-
-int _add_label_info_into_list(const char *locale, char *value, GList **label)
-{
-       label_x *info;
-
-       info = calloc(1, sizeof(label_x));
-       if (info == NULL) {
-               LOGE("out of memory");
-               return PMINFO_R_ERROR;
-       }
-       info->text = value;
-       info->lang = strdup(locale);
-       *label = g_list_prepend(*label, info);
-
-       return PMINFO_R_OK;
-}
-
-char *_get_system_locale(void)
-{
-       char *lang;
-       char *locale;
-
-       lang = vconf_get_str(VCONFKEY_LANGSET);
-       if (lang == NULL) {
-               locale = strdup(DEFAULT_LOCALE);
-               if (locale == NULL) {
-                       LOGE("out of memory");
-                       return NULL;
-               }
-               return locale;
-       }
-
-       locale = malloc(sizeof(char) * 6);
-       if (locale == NULL) {
-               LOGE("out of memory");
-               free(lang);
-               return NULL;
-       }
-
-       strncpy(locale, lang, 2);
-       locale[2] = '-';
-       locale[3] = tolower(lang[3]);
-       locale[4] = tolower(lang[4]);
-       locale[5] = '\0';
-
-       free(lang);
-
-       return locale;
-}
-
-int __pkginfo_check_installed_storage(package_x *pkginfo)
-{
-       char buf[MAX_QUERY_LEN] = {'\0'};
-       int ret;
-
-       retvm_if(pkginfo->package == NULL, PMINFO_R_OK, "pkgid is NULL\n");
-       retvm_if(pkginfo->installed_storage == NULL, PMINFO_R_ERROR,
-                       "installed_storage is NULL\n");
-
-       if (strcmp(pkginfo->installed_storage, "installed_external") == 0) {
-               snprintf(buf, MAX_QUERY_LEN - 1, "%s", pkginfo->external_path);
-               ret = access(buf, R_OK);
-               if (ret != 0) {
-                       _LOGE("can not access [%s] - %d", buf, ret);
-                       return PMINFO_R_ERROR;
-               }
-       }
-
-       return PMINFO_R_OK;
-}
-
-int __appinfo_check_installed_storage(application_x *appinfo)
-{
-       retvm_if(appinfo->installed_storage == NULL, PMINFO_R_ERROR,
-                       "installed_storage is NULL\n");
-
-       if (strcmp(appinfo->installed_storage, "installed_external") == 0) {
-               retvm_if(appinfo->external_path == NULL, PMINFO_R_ERROR,
-                               "external path is NULL\n");
-               if (access(appinfo->external_path, R_OK) != 0) {
-                       _LOGE("can not access [%s]", appinfo->external_path);
-                       return PMINFO_R_ERROR;
-               }
-       }
-
-       return PMINFO_R_OK;
-}
-
-#define BUSY_WAITING_USEC (1000000 / 10 / 2) /* 0.05 sec */
-#define BUSY_WAITING_MAX 100 /* wait for max 5 sec */
-static int __db_busy_handler(void *data, int count)
-{
-       if (count < BUSY_WAITING_MAX) {
-               usleep(BUSY_WAITING_USEC);
-               return 1;
-       } else {
-               /* sqlite3_prepare_v2 will return SQLITE_BUSY */
-               return 0;
-       }
-}
-
-int __open_db(const char *path, sqlite3 **db, int flags)
-{
-       int ret;
-
-       ret = sqlite3_open_v2(path, db, flags, NULL);
-       if (ret != SQLITE_OK) {
-               sqlite3_close_v2(*db);
-               return ret;
-       }
-
-       ret = sqlite3_busy_handler(*db, __db_busy_handler, NULL);
-       if (ret != SQLITE_OK) {
-               _LOGE("failed to register busy handler: %s",
-                               sqlite3_errmsg(*db));
-               sqlite3_close_v2(*db);
-               return ret;
-       }
-
-       return ret;
-}
-
-struct type_map {
-       const char *manifest;
-       const char *type;
-};
-
-struct type_map type_map[] = {
-       { "res/wgt/config.xml", "wgt" },
-       { "config.xml", "wgt" },
-       { "tizen-manifest.xml", "tpk" },
-       { NULL, NULL}
-};
-
-char *__get_type_from_path(const char *pkg_path)
-{
-       const char *type = NULL;
-       unzFile uf;
-       int i;
-
-       uf = unzOpen(pkg_path);
-       if (uf == NULL) {
-               _LOGE("failed to open zip file %s", pkg_path);
-               return NULL;
-       }
-
-       for (i = 0; type_map[i].manifest != NULL; i++) {
-               if (unzLocateFile(uf, type_map[i].manifest, 0) == UNZ_OK) {
-                       _LOGD("pkgtype of %s: [%s]", pkg_path,
-                                       type_map[i].type);
-                       type = type_map[i].type;
-                       break;
-               }
-       }
-       unzClose(uf);
-
-       if (type == NULL) {
-               _LOGE("cannot get pkg type of file %s", pkg_path);
-               return NULL;
-       }
-
-       return strdup(type);
-}
-
-static const char *__get_library_path(const char *pkg_type)
-{
-       char buf[64];
-       const char *path;
-
-       snprintf(buf, sizeof(buf), "package-manager/backendlib/lib%s.so",
-                       pkg_type);
-       path = tzplatform_mkpath(TZ_SYS_RO_ETC, buf);
-
-       return path;
-}
-
-pkg_plugin_set *__load_library(const char *pkg_type)
-{
-       void *library_handle;
-       pkg_plugin_set *plugin_set;
-       bool (*on_load)(pkg_plugin_set *plugin);
-       const char *library_path;
-
-       library_path = __get_library_path(pkg_type);
-       if (library_path == NULL) {
-               _LOGE("cannot get library path for %s", pkg_type);
-               return NULL;
-       }
-
-       if (plugin_set_list == NULL) {
-               plugin_set_list = g_hash_table_new_full(g_str_hash,
-                               g_str_equal, free, free);
-               if (plugin_set_list == NULL) {
-                       _LOGE("out of memory");
-                       return NULL;
-               }
-       }
-
-       plugin_set = (pkg_plugin_set *)g_hash_table_lookup(plugin_set_list,
-                       (gconstpointer)pkg_type);
-       if (plugin_set) {
-               _LOGD("already loaded [%s]", library_path);
-               return plugin_set;
-       }
-
-       if ((library_handle = dlopen(library_path, RTLD_LAZY)) == NULL) {
-               _LOGE("dlopen is failed library_path[%s]", library_path);
-               return NULL;
-       }
-
-       if ((on_load = dlsym(library_handle, "pkg_plugin_on_load")) == NULL ||
-                       dlerror() != NULL) {
-               _LOGE("cannot find symbol");
-               dlclose(library_handle);
-               return NULL;
-       }
-
-       plugin_set = (pkg_plugin_set *)calloc(1, sizeof(pkg_plugin_set));
-       if (plugin_set == NULL) {
-               _LOGE("out of memory");
-               dlclose(library_handle);
-               return NULL;
-       }
-
-       if (on_load(plugin_set) != 0) {
-               _LOGE("pkg_plugin_on_load failed");
-               free(plugin_set);
-               dlclose(library_handle);
-               plugin_set = NULL;
-               return NULL;
-       }
-
-       plugin_set->plugin_handle = library_handle;
-       snprintf(plugin_set->pkg_type,
-                       sizeof(plugin_set->pkg_type), "%s", pkg_type);
-
-       g_hash_table_insert(plugin_set_list, (gpointer)strdup(pkg_type),
-                       (gpointer)plugin_set);
-
-       _LOGD("library [%s] is loaded", library_path);
-
-       return plugin_set;
-}
-
-void __unload_library(const char *pkg_type)
-{
-       pkg_plugin_set *plugin_set;
-
-       if (plugin_set_list == NULL)
-               return;
-
-       plugin_set = (pkg_plugin_set *)g_hash_table_lookup(plugin_set_list,
-                       (gconstpointer)pkg_type);
-
-       if (plugin_set == NULL) {
-               _LOGE("pkg plugin for %s is not loaded", pkg_type);
-               return;
-       }
-
-       plugin_set->plugin_on_unload();
-       dlclose(plugin_set->plugin_handle);
-       g_hash_table_remove(plugin_set_list, (gconstpointer)pkg_type);
-}
diff --git a/src/pkgmgrinfo_private.h b/src/pkgmgrinfo_private.h
deleted file mode 100644 (file)
index 47d4dc3..0000000
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * pkgmgr-info
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
- * Jaeho Lee <jaeho81.lee@samsung.com>, Shobhit Srivastava <shobhit.s@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-
-#ifndef __PKGMGRINFO_PRIVATE_H__
-#define __PKGMGRINFO_PRIVATE_H__
-
-#include <stdbool.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include <sqlite3.h>
-#include <glib.h>
-#include <tzplatform_config.h>
-
-#include "pkgmgrinfo_type.h"
-#include "pkgmgrinfo_basic.h"
-
-#ifndef DEPRECATED
-#define DEPRECATED     __attribute__ ((__deprecated__))
-#endif
-
-#ifndef API
-#define API __attribute__ ((visibility("default")))
-#endif
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "PKGMGR_INFO"
-
-#define ASC_CHAR(s) (const char *)s
-#define XML_CHAR(s) (const xmlChar *)s
-
-#define MANIFEST_DB    tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_parser.db")
-#define MAX_QUERY_LEN  4096
-#define MAX_CERT_TYPE  9
-#define CERT_DB                tzplatform_mkpath(TZ_SYS_DB, ".pkgmgr_cert.db")
-#define PKG_STRING_LEN_MAX 1024
-#define PKG_TYPE_STRING_LEN_MAX                128
-#define PKG_VERSION_STRING_LEN_MAX     128
-#define PKG_VALUE_STRING_LEN_MAX               512
-#define PKG_RW_PATH tzplatform_mkpath(TZ_USER_APP, "")
-#define PKG_RO_PATH tzplatform_mkpath(TZ_SYS_RO_APP, "")
-#define BLOCK_SIZE      4096 /*in bytes*/
-#define BUFSIZE 4096
-#define ROOT_UID 0
-#define APPFW_UID 301
-
-#define PKG_SD_PATH tzplatform_mkpath3(TZ_SYS_STORAGE, "sdcard", "app2sd/")
-#define PKG_INSTALLATION_PATH tzplatform_mkpath(TZ_USER_APP, "")
-
-#define SERVICE_NAME "org.tizen.system.deviced"
-#define PATH_NAME "/Org/Tizen/System/DeviceD/Mmc"
-#define INTERFACE_NAME "org.tizen.system.deviced.Mmc"
-#define METHOD_NAME "RequestMountApp2ext"
-
-/*String properties for filtering based on package info*/
-typedef enum _pkgmgrinfo_pkginfo_filter_prop_str {
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR = 101,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_ID = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_STR,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_TYPE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_VERSION,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALL_LOCATION,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR = E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE
-} pkgmgrinfo_pkginfo_filter_prop_str;
-
-/*Boolean properties for filtering based on package info*/
-typedef enum _pkgmgrinfo_pkginfo_filter_prop_bool {
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL = 201,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_BOOL,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_READONLY,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_UPDATE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_APPSETTING,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_DISABLE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_CHECK_STORAGE,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_BOOL = E_PMINFO_PKGINFO_PROP_PACKAGE_SYSTEM
-} pkgmgrinfo_pkginfo_filter_prop_bool;
-
-/*Integer properties for filtering based on package info*/
-typedef enum _pkgmgrinfo_pkginfo_filter_prop_int {
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT = 301,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE = E_PMINFO_PKGINFO_PROP_PACKAGE_MIN_INT,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_INT = E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE
-} pkgmgrinfo_pkginfo_filter_prop_int;
-
-/*String properties for filtering based on app info*/
-typedef enum _pkgmgrinfo_appinfo_filter_prop_str {
-       E_PMINFO_APPINFO_PROP_APP_MIN_STR = 401,
-       E_PMINFO_APPINFO_PROP_APP_ID = E_PMINFO_APPINFO_PROP_APP_MIN_STR,
-       E_PMINFO_APPINFO_PROP_APP_COMPONENT,
-       E_PMINFO_APPINFO_PROP_APP_EXEC,
-       E_PMINFO_APPINFO_PROP_APP_ICON,
-       E_PMINFO_APPINFO_PROP_APP_TYPE,
-       E_PMINFO_APPINFO_PROP_APP_OPERATION,
-       E_PMINFO_APPINFO_PROP_APP_URI,
-       E_PMINFO_APPINFO_PROP_APP_MIME,
-       E_PMINFO_APPINFO_PROP_APP_HWACCELERATION,
-       E_PMINFO_APPINFO_PROP_APP_CATEGORY,
-       E_PMINFO_APPINFO_PROP_APP_SCREENREADER,
-       E_PMINFO_APPINFO_PROP_APP_PACKAGE,
-       E_PMINFO_APPINFO_PROP_APP_INSTALLED_STORAGE,
-       E_PMINFO_APPINFO_PROP_PRIVILEGE,
-       E_PMINFO_APPINFO_PROP_APP_MAX_STR = E_PMINFO_APPINFO_PROP_PRIVILEGE
-} pkgmgrinfo_appinfo_filter_prop_str;
-
-/*Boolean properties for filtering based on app info*/
-typedef enum _pkgmgrinfo_appinfo_filter_prop_bool {
-       E_PMINFO_APPINFO_PROP_APP_MIN_BOOL = 501,
-       E_PMINFO_APPINFO_PROP_APP_NODISPLAY = E_PMINFO_APPINFO_PROP_APP_MIN_BOOL,
-       E_PMINFO_APPINFO_PROP_APP_MULTIPLE,
-       E_PMINFO_APPINFO_PROP_APP_ONBOOT,
-       E_PMINFO_APPINFO_PROP_APP_AUTORESTART,
-       E_PMINFO_APPINFO_PROP_APP_TASKMANAGE,
-       E_PMINFO_APPINFO_PROP_APP_LAUNCHCONDITION,
-       E_PMINFO_APPINFO_PROP_APP_UI_GADGET,
-       E_PMINFO_APPINFO_PROP_APP_DISABLE,
-       E_PMINFO_APPINFO_PROP_APP_SUPPORT_DISABLE,
-       E_PMINFO_APPINFO_PROP_APP_CHECK_STORAGE,
-       E_PMINFO_APPINFO_PROP_PKG_DISABLE,
-       E_PMINFO_APPINFO_PROP_APP_MAX_BOOL = E_PMINFO_APPINFO_PROP_PKG_DISABLE
-} pkgmgrinfo_appinfo_filter_prop_bool;
-
-/*Integer properties for filtering based on app info*/
-typedef enum _pkgmgrinfo_appinfo_filter_prop_int {
-       /*Currently No Fields*/
-       E_PMINFO_APPINFO_PROP_APP_MIN_INT = 601,
-       E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE = E_PMINFO_APPINFO_PROP_APP_MIN_INT,
-       E_PMINFO_APPINFO_PROP_APP_MAX_INT = E_PMINFO_APPINFO_PROP_APP_SUPPORT_MODE
-} pkgmgrinfo_appinfo_filter_prop_int;
-
-/*Integer properties for filtering based on app info*/
-typedef enum _pkgmgrinfo_pkginfo_filter_prop_range {
-       /*Currently No Fields*/
-       E_PMINFO_PKGINFO_PROP_RANGE_MIN_INT = 701,
-       E_PMINFO_PKGINFO_PROP_RANGE_BASIC,
-       E_PMINFO_PKGINFO_PROP_RANGE_MAX_INT = E_PMINFO_PKGINFO_PROP_RANGE_BASIC
-} pkgmgrinfo_pkginfo_filter_prop_range;
-
-typedef enum _pkgmgrinfo_pkginfo_join_flag {
-       E_PMINFO_PKGINFO_JOIN_LOCALIZED_INFO = 0x0001,
-       E_PMINFO_PKGINFO_JOIN_PRIVILEGE_INFO = 0x0002,
-} pkgmgrinfo_pkginfo_join_flag;
-
-typedef enum _pkgmgrinfo_appinfo_join_flag {
-       E_PMINFO_APPINFO_JOIN_LOCALIZED_INFO = 0x0001,
-       E_PMINFO_APPINFO_JOIN_CATEGORY = 0x0002,
-       E_PMINFO_APPINFO_JOIN_APP_CONTROL = 0x0004,
-       E_PMINFO_APPINFO_JOIN_METADATA = 0x0008,
-       E_PMINFO_APPINFO_JOIN_PRIVILEGE = 0x0010,
-} pkgmgrinfo_appinfo_join_flag;
-
-typedef enum _pkgmgrinfo_appinfo_disable_type {
-       E_APPINFO_DISABLE_TYPE_PKG = 0,
-       E_APPINFO_DISABLE_TYPE_APP
-} pkgmgrinfo_appinfo_disable_type;
-
-typedef struct _pkgmgr_pkginfo_x {
-       uid_t uid;
-       package_x *pkg_info;
-       char *locale;
-} pkgmgr_pkginfo_x;
-
-typedef struct _pkgmgr_appinfo_x {
-       const char *package;
-       char *locale;
-       pkgmgrinfo_app_component app_component;
-       application_x *app_info;
-} pkgmgr_appinfo_x;
-
-/*For filter APIs*/
-typedef struct _pkgmgrinfo_filter_x {
-       uid_t uid;
-       GSList *list;
-       GSList *list_metadata;
-} pkgmgrinfo_filter_x;
-
-typedef struct _pkgmgrinfo_node_x {
-       int prop;
-       char *key;
-       char *value;
-} pkgmgrinfo_node_x;
-
-typedef struct _pkgmgrinfo_metadata_node_x {
-       char *key;
-       char *value;
-} pkgmgrinfo_metadata_node_x;
-
-typedef struct _pkgmgrinfo_appcontrol_x {
-       int operation_count;
-       int uri_count;
-       int mime_count;
-       int subapp_count;
-       char **operation;
-       char **uri;
-       char **mime;
-       char **subapp;
-} pkgmgrinfo_appcontrol_x;
-
-typedef struct _pkgmgr_certinfo_x {
-       int for_all_users;
-       char *pkgid;
-       char *cert_value;
-       char *cert_info[MAX_CERT_TYPE]; /*certificate info*/
-       int cert_id[MAX_CERT_TYPE];             /*certificate ID in index table*/
-} pkgmgr_certinfo_x;
-
-typedef struct _db_handle {
-       sqlite3 *dbHandle;
-       int ref;
-} db_handle;
-
-/* TODO: refine below structures */
-#define PKG_TYPE_STRING_LEN_MAX        128
-#define PKG_NAME_STRING_LEN_MAX        128
-#define PKG_VERSION_STRING_LEN_MAX     128
-#define PKG_VALUE_STRING_LEN_MAX 512
-#define PKG_URL_STRING_LEN_MAX 1024
-#define PKG_LABEL_STRING_LEN_MAX 128
-#define PKG_PATH_STRING_LEN_MAX 512
-#define PKG_DEP_TYPE_STRING_LEN_MAX 128
-
-typedef struct _package_manager_pkg_info_t {
-       char pkg_type[PKG_TYPE_STRING_LEN_MAX];
-       char pkg_name[PKG_NAME_STRING_LEN_MAX];
-       char pkgid[PKG_NAME_STRING_LEN_MAX];
-       char version[PKG_VERSION_STRING_LEN_MAX];
-       struct _package_manager_pkg_info_t *next;
-} package_manager_pkg_info_t;
-
-typedef struct _package_manager_pkg_dependency_info_t {
-       char pkgid[PKG_NAME_STRING_LEN_MAX];
-       char type[PKG_DEP_TYPE_STRING_LEN_MAX];
-       char required_version[PKG_VERSION_STRING_LEN_MAX];
-} pkg_dependency_info_t;
-
-typedef struct _package_manager_pkg_detail_info_t {
-       char pkg_type[PKG_TYPE_STRING_LEN_MAX];
-       char pkg_name[PKG_NAME_STRING_LEN_MAX];
-       char pkgid[PKG_NAME_STRING_LEN_MAX];
-       char version[PKG_VERSION_STRING_LEN_MAX];
-       char api_version[PKG_VERSION_STRING_LEN_MAX];
-       char pkg_description[PKG_VALUE_STRING_LEN_MAX];
-       char min_platform_version[PKG_VERSION_STRING_LEN_MAX];
-       time_t installed_time;  /* installed time it must be GMT+0 time */
-       int installed_size;             /* installed total size */
-       int app_size;                   /* installed app size */
-       int data_size;                  /* data size which is made on run time */
-       char optional_id[PKG_NAME_STRING_LEN_MAX]; /*package ID if exists */
-       void *pkg_optional_info;
-       char label[PKG_LABEL_STRING_LEN_MAX];
-       char author[PKG_VALUE_STRING_LEN_MAX];
-       char *icon_buf;
-       int icon_size;
-       GList *privilege_list;
-       GList *dependency_list;
-} package_manager_pkg_detail_info_t;
-
-typedef void (*_pkg_plugin_unload)(void);
-typedef int (*_pkg_plugin_pkg_is_installed) (const char *pkgid);
-typedef int (*_pkg_plugin_get_installed_pkg_list)(
-               const char *category, const char *option,
-               package_manager_pkg_info_t **list, int *count);
-typedef int (*_pkg_plugin_get_pkg_detail_info)(const char *pkgid,
-               package_manager_pkg_detail_info_t *pkg_detail_info);
-typedef int (*_pkg_plugin_get_pkg_detail_info_from_package)(
-               const char *pkg_path,
-               package_manager_pkg_detail_info_t *pkg_detail_info);
-
-typedef struct _pkg_plugin_set {
-       char pkg_type[PKG_TYPE_STRING_LEN_MAX];
-       void *plugin_handle;
-       _pkg_plugin_unload plugin_on_unload;
-       _pkg_plugin_pkg_is_installed pkg_is_installed;
-       _pkg_plugin_get_installed_pkg_list get_installed_pkg_list;
-       _pkg_plugin_get_pkg_detail_info get_pkg_detail_info;
-       _pkg_plugin_get_pkg_detail_info_from_package
-       get_pkg_detail_info_from_package;
-} pkg_plugin_set;
-
-pkgmgrinfo_pkginfo_filter_prop_str _pminfo_pkginfo_convert_to_prop_str(const char *property);
-pkgmgrinfo_pkginfo_filter_prop_int _pminfo_pkginfo_convert_to_prop_int(const char *property);
-pkgmgrinfo_pkginfo_filter_prop_bool _pminfo_pkginfo_convert_to_prop_bool(const char *property);
-
-pkgmgrinfo_appinfo_filter_prop_str _pminfo_appinfo_convert_to_prop_str(const char *property);
-pkgmgrinfo_appinfo_filter_prop_int _pminfo_appinfo_convert_to_prop_int(const char *property);
-pkgmgrinfo_appinfo_filter_prop_bool _pminfo_appinfo_convert_to_prop_bool(const char *property);
-
-pkgmgrinfo_pkginfo_filter_prop_range _pminfo_pkginfo_convert_to_prop_range(const char *property);
-
-int _check_create_cert_db(void);
-void _save_column_int(sqlite3_stmt *stmt, int idx, int *i);
-void _save_column_str(sqlite3_stmt *stmt, int idx, char **str);
-char *_get_system_locale(void);
-int __get_filter_condition(gpointer data, uid_t uid, char **condition, GList **param);
-int __get_metadata_filter_condition(gpointer data, char **condition, GList **param);
-int _add_icon_info_into_list(const char *locale, char *value, GList **icon);
-int _add_label_info_into_list(const char *locale, char *value, GList **label);
-int __pkginfo_check_installed_storage(package_x *pkginfo);
-int __appinfo_check_installed_storage(application_x *appinfo);
-int __open_db(const char *path, sqlite3 **db, int flags);
-char *__get_type_from_path(const char *pkg_path);
-pkg_plugin_set *__load_library(const char *pkg_type);
-void __unload_library(const char *pkg_type);
-
-#define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
-#define REGULAR_USER 5000
-static inline uid_t _getuid(void)
-{
-       uid_t uid = getuid();
-
-       if (uid < REGULAR_USER)
-               return tzplatform_getuid(TZ_SYS_GLOBALAPP_USER);
-       else
-               return uid;
-}
-
-#endif  /* __PKGMGRINFO_PRIVATE_H__ */
index 6920722..fd46548 100644 (file)
@@ -21,9 +21,9 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
 
 ### Build
 ADD_EXECUTABLE(${PKG_DB_RECOVERY} ${CMAKE_CURRENT_SOURCE_DIR}/${PKG_DB_RECOVERY}.c)
-TARGET_LINK_LIBRARIES(${PKG_DB_RECOVERY} pkgmgr_parser pkgmgr-info ${TOOL_DEPS_LDFLAGS} "-pie")
+TARGET_LINK_LIBRARIES(${PKG_DB_RECOVERY} pkgmgr_parser pkgmgr-info pkgmgr_common ${TOOL_DEPS_LDFLAGS} "-pie")
 ADD_EXECUTABLE(${PKG_DB_CREATOR} ${CMAKE_CURRENT_SOURCE_DIR}/${PKG_DB_CREATOR}.c)
-TARGET_LINK_LIBRARIES(${PKG_DB_CREATOR} pkgmgr_parser pkgmgr-info ${TOOL_DEPS_LDFLAGS} "-pie")
+TARGET_LINK_LIBRARIES(${PKG_DB_CREATOR} pkgmgr_parser pkgmgr-info pkgmgr_common ${TOOL_DEPS_LDFLAGS} "-pie")
 
 ## Install
 INSTALL(TARGETS ${PKG_DB_RECOVERY} DESTINATION bin)