Remove AIL dependencies
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 3 Jul 2014 05:37:59 +0000 (14:37 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 3 Jul 2014 05:37:59 +0000 (14:37 +0900)
Change-Id: Ia32ff80bdc7eb7b0b4546c03eed93ea2bf74407f

CMakeLists.txt
packaging/data-provider-master.spec
src/package.c
src/server.c
util_liveinfo/src/liveinfo.c

index a6fdb0a..920e531 100755 (executable)
@@ -3,7 +3,6 @@ PROJECT(data-provider-master C)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkg REQUIRED
-       ail
        dlog
        aul
        vconf
@@ -22,6 +21,7 @@ pkg_check_modules(pkg REQUIRED
        badge-service
        libsmack
        shortcut
+       pkgmgr-info
 )
 
 IF (LIVEBOX)
index 0db2c59..1f69865 100755 (executable)
@@ -2,14 +2,13 @@
 
 Name: data-provider-master
 Summary: Master service provider for liveboxes
-Version: 0.44.4
+Version: 0.44.5
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
 Source0: %{name}-%{version}.tar.gz
 Source1001: %{name}.manifest
 BuildRequires: cmake, gettext-tools, smack, coreutils
-BuildRequires: pkgconfig(ail)
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(aul)
 BuildRequires: pkgconfig(vconf)
@@ -39,6 +38,7 @@ BuildRequires: pkgconfig(eina)
 BuildRequires: pkgconfig(com-core)
 BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(pkgmgr)
+BuildRequires: pkgconfig(pkgmgr-info)
 
 # This will not be works, I know. But...
 %if "%{sec_product_feature_livebox}" != "0"
index cc38ff7..05f691d 100644 (file)
@@ -25,6 +25,7 @@
 #include <packet.h>
 #include <livebox-errno.h>
 #include <livebox-service.h>
+#include <pkgmgr-info.h>
 #include <ail.h>
 
 #include "critical_log.h"
@@ -1559,22 +1560,23 @@ HAPI int const package_fault_count(struct pkg_info *info)
 
 HAPI int package_is_enabled(const char *appid)
 {
-       ail_appinfo_h ai;
+       pkgmgrinfo_appinfo_h handle;
        bool enabled;
        int ret;
 
-       ret = ail_get_appinfo(appid, &ai);
-       if (ret != AIL_ERROR_OK) {
-               ErrPrint("Unable to get appinfo (%s): %d\n", appid, ret);
+       ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
+       if (ret != PMINFO_R_OK) {
+               ErrPrint("Failed to get info\n");
                return 0;
        }
 
-       if (ail_appinfo_get_bool(ai, AIL_PROP_X_SLP_ENABLED_BOOL, &enabled) != AIL_ERROR_OK) {
+       ret = pkgmgrinfo_appinfo_is_enabled(handle, &enabled);
+       if (ret != PMINFO_R_OK) {
+               ErrPrint("Failed to get info\n");
                enabled = false;
        }
 
-       ail_destroy_appinfo(ai);
-
+       pkgmgrinfo_appinfo_destroy_appinfo(handle);
        return enabled == true;
 }
 
index 8637c6d..701060a 100644 (file)
@@ -7662,8 +7662,9 @@ static Eina_Bool inst_list_cb(void *info)
 
        inst_list = package_instance_list(pkg);
        EINA_LIST_FOREACH(inst_list, l, inst) {
-               fprintf(fp, "%s %s %s %lf %s %d %d\n",
+               fprintf(fp, "%s %s %s %s %lf %s %d %d\n",
                        instance_id(inst),
+                       buffer_handler_id(instance_lb_buffer(inst)),
                        instance_cluster(inst),
                        instance_category(inst),
                        instance_period(inst),
index 86d109c..31bd6e2 100644 (file)
@@ -63,6 +63,7 @@ struct package {
 
 struct instance {
        char *id;
+       char *buf_id;
        char *cluster;
        char *category;
        double period;
@@ -205,6 +206,7 @@ static void inst_del_cb(struct node *node)
        }
 
        free(info->id);
+       free(info->buf_id);
        free(info->cluster);
        free(info->category);
        free(info->state);
@@ -270,7 +272,7 @@ static void ls(void)
 
                        info = node_data(node);
 
-                       printf(" %5.2f %6s %10s %10s %4dx%-4d ", info->period, info->state, info->cluster, info->category, info->width, info->height);
+                       printf(" %5.2f %s %6s %10s %10s %4dx%-4d ", info->period, info->buf_id, info->state, info->cluster, info->category, info->width, info->height);
                        snprintf(buf, sizeof(buf), "/opt/usr/share/live_magazine/reader/%s", node_name(node));
                        if (lstat(buf, &stat) < 0) {
                                printf("%3d ERR ", errno);
@@ -1433,8 +1435,10 @@ static void processing_line_buffer(const char *buffer)
        char pkgname[256];
        char abi[256];
        char inst_id[4096];
+       char buf_id[256];
        char cluster[256];
        char category[256];
+       char str_period[64];
        char state[10];
        int refcnt;
        int fault_count;
@@ -1570,11 +1574,13 @@ static void processing_line_buffer(const char *buffer)
                slaveinfo->ttl = ttl;
                break;
        case INST_LIST:
-               if (sscanf(buffer, "%[^ ] %[^ ] %[^ ] %lf %[^ ] %d %d", inst_id, cluster, category, &period, state, &width, &height) != 7) {
+               if (sscanf(buffer, "%[^ ] %[^ ] %[^ ] %[^ ] %[^ ] %[^ ] %d %d", inst_id, buf_id, cluster, category, str_period, state, &width, &height) != 8) {
                        printf("Invalid format : [%s]\n", buffer);
                        return;
                }
 
+               period = strtod(str_period, NULL);
+
                for (i = strlen(inst_id); i > 0 && inst_id[i] != '/'; i--);
                i += (inst_id[i] == '/');
 
@@ -1601,6 +1607,7 @@ static void processing_line_buffer(const char *buffer)
                node_set_age(node, s_info.age);
 
                free(instinfo->id);
+               free(instinfo->buf_id);
                free(instinfo->cluster);
                free(instinfo->category);
                free(instinfo->state);
@@ -1625,6 +1632,10 @@ static void processing_line_buffer(const char *buffer)
                        printf("Error: %s\n", strerror(errno));
                }
 
+               if (strlen(buf_id)) {
+                       instinfo->buf_id = strdup(buf_id);
+               }
+
                instinfo->period = period;
                instinfo->width = width;
                instinfo->height = height;