From: Hwankyu Jhun Date: Thu, 21 Oct 2021 00:15:07 +0000 (+0900) Subject: Add pkgmgr-info-server pkgconfig file X-Git-Tag: accepted/tizen/6.5/unified/20211109.041719~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=054b7b8dc8b016dc39458bde0f313f3710ebd2d6;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Add pkgmgr-info-server pkgconfig file To improve db direct access performance, the pkgmgr-info-server.pc file is added for compilation. The amd package will be built using the pkgconfig. This is to remove the behavior of opening the so file at runtime. Change-Id: I1c7b9eae6bd181c8b89c8b13735df7788b5ddbf3 Signed-off-by: Hwankyu Jhun --- diff --git a/packaging/pkgmgr-info.spec b/packaging/pkgmgr-info.spec index 6d2114c..8612564 100755 --- a/packaging/pkgmgr-info.spec +++ b/packaging/pkgmgr-info.spec @@ -153,10 +153,12 @@ install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj %defattr(-,root,root,-) %{_includedir}/*.h %{_libdir}/pkgconfig/pkgmgr-info.pc +%{_libdir}/pkgconfig/pkgmgr-info-server.pc %{_libdir}/libpkgmgr-info.so %{_libdir}/libpkgmgr-info-server.so %{_includedir}/pkgmgr-client/*.hh %{_includedir}/pkgmgr-common/*.hh +%{_includedir}/pkgmgr-server/*.h %files parser %manifest %{name}.manifest diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index e2c9a9d..19ed9da 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -21,7 +21,11 @@ SET_TARGET_PROPERTIES(pkgmgr-info-server PROPERTIES SOVERSION ${MAJORVER}) SET_TARGET_PROPERTIES(pkgmgr-info-server PROPERTIES VERSION ${FULLVER}) TARGET_LINK_LIBRARIES(pkgmgr-info-server pkgmgr-info ${libpkgs_server_LDFLAGS}) +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/pkgmgr-info-server.pc.in ${CMAKE_CURRENT_SOURCE_DIR}/pkgmgr-info-server.pc @ONLY) + INSTALL(TARGETS pkgmgr-info-server DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/request_handler/request_handler_direct_access.h DESTINATION include/pkgmgr-server) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/pkgmgr-info-server.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) ADD_EXECUTABLE(${PKGINFO_SERVER} main.cc) diff --git a/src/server/pkgmgr-info-server.pc.in b/src/server/pkgmgr-info-server.pc.in new file mode 100644 index 0000000..ec65c96 --- /dev/null +++ b/src/server/pkgmgr-info-server.pc.in @@ -0,0 +1,13 @@ +# Package Information for pkg-config + +prefix=/usr +exec_prefix=${prefix} +libdir=@LIB_INSTALL_DIR@ +includedir=${prefix}/include + +Name: pkgmgr-info-server +Description: Package Manager Info Libarary (Server) +Version: @FULLVER@ +Requires: +Libs: -L${libdir} -lpkgmgr-info-server +Cflags: -I${includedir} -I${includedir}/pkgmgr-server -DSYSCONFDIR=\"@SYSCONFDIR@\" diff --git a/src/server/request_handler/request_handler_direct_access.cc b/src/server/request_handler/request_handler_direct_access.cc index b7b8adc..904662c 100644 --- a/src/server/request_handler/request_handler_direct_access.cc +++ b/src/server/request_handler/request_handler_direct_access.cc @@ -37,6 +37,11 @@ extern "C" EXPORT_API void* _request_handler_direct_access(int req_type, unsigned char* data, int size, const char *locale) { + if (data == nullptr || size < 0 || locale == nullptr) { + LOG(ERROR) << "Invalid parameter"; + return nullptr; + } + std::unique_ptr handler; switch (req_type) {