Remove dependency to libsyscommon and add .gitignore 22/274322/1 accepted/tizen/6.5/unified/20220428.162726 submit/tizen_6.5/20220426.081231 submit/tizen_6.5/20220427.024640
authorHyotaek Shim <hyotaek.shim@samsung.com>
Wed, 13 Apr 2022 05:47:46 +0000 (14:47 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 26 Apr 2022 07:37:50 +0000 (07:37 +0000)
Change-Id: I7be05f4c6b225786fa9d66f9cbd5fa5c8b4a2bcf
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 680135fc0775f8111c853f6c25b1cbedd2c1a08c)

.gitignore [new file with mode: 0644]
packaging/capi-system-info.spec
tool/CMakeLists.txt
tool/system-info-tool.c
tool/system-info-tool.h

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..9306ae6
--- /dev/null
@@ -0,0 +1,3 @@
+cscope.files
+cscope.out
+tags
index a87e88cf4c7e39f4f191014fb5e9c86a79b80f6c..dcf60a3fac5b9b6b3dbff2fe56d4b0daf9f7486f 100644 (file)
@@ -14,7 +14,6 @@ BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(uuid)
-BuildRequires:  pkgconfig(libsyscommon)
 BuildRequires:  glibc-devel-static
 Requires: security-config
 
index 5f44875c4e71dc9992da29e39069db9cbb8565af..ca950b44fa1688ed4cfd89daa6dd9825a389cd46 100755 (executable)
@@ -1,7 +1,7 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(TOOL_REQUIRED REQUIRED libsyscommon)
+PKG_CHECK_MODULES(TOOL_REQUIRED REQUIRED glib-2.0)
 
 SET(SYSTEM_INFO_TOOL "system-info-tool")
 FILE(GLOB SRCS "*.c")
index 4f031ca39a1b591a669d66b35e43c5b17c5dae06..e1aaa9149a3ae3440bdc35fdf2d9c1968122defa 100644 (file)
@@ -1,8 +1,8 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <getopt.h>
-#include <libsyscommon/list.h>
 
+#include <glib.h>
 #include "system-info-tool.h"
 #include "system-info-tool-get.h"
 #include "system-info-tool-set.h"
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
                        break;
                switch (opt) {
                case 'g':
-                       SYS_G_LIST_APPEND(keys, strdup(optarg));
+                       SYSINFO_G_LIST_APPEND(keys, strdup(optarg));
                        break;
                case 'v':
                        verbose = true;
@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
                }
        }
 
-       SYS_G_LIST_FOREACH(keys, elem, key) {
+       SYSINFO_G_LIST_FOREACH(keys, elem, key) {
                system_info_tool_get(key, verbose);
                free(key);
        }
index ce8daa6d7d8afd9e3e8bf6bf1e9acfe980c503e8..d8895b781006b58047c9b13ada1c878ff94b1fbb 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <unistd.h>
 #include <stdlib.h>
+#include <glib.h>
 
 #include <system_info.h>
 #include <system_info_type.h>
@@ -78,4 +79,12 @@ system_info_type_e string_to_type(const char *type);
 void print_value(struct value value);
 int convert_raw_key(const char *key, char *buffer, int len);
 
+#define SYSINFO_G_LIST_APPEND(a, b)        \
+       a = g_list_append(a, (gpointer)b)
+
+#define SYSINFO_G_LIST_FOREACH(head, elem, node)   \
+       for (elem = head, node = NULL; \
+               elem && ((node = elem->data) != NULL); \
+               elem = elem->next, node = NULL)
+
 #endif