Add upgrade api to pkgmgr plugin
authorHyunwoo Kim <hwlove.kim@samsung.com>
Tue, 18 Jun 2013 08:46:51 +0000 (17:46 +0900)
committerHyunwoo Kim <hwlove.kim@samsung.com>
Tue, 18 Jun 2013 08:50:13 +0000 (17:50 +0900)
Change-Id: I5867b7e09dbac2bb6e5c99b00e36b00a256b5182
Signed-off-by: Hyunwoo Kim <hwlove.kim@samsung.com>
packaging/privacy-manager.spec
pkgmgr_plugin/privileges.cpp

index d367ba6c52f84ab9c4a0f1709c5946d48ed7f482..4efcc00b52132584076678c0732ceb5bf94d08c0 100755 (executable)
@@ -1,7 +1,7 @@
 Name:    privacy-manager-server
 Summary: Privacy Management
 Version: 0.0.3
-Release: 4
+Release: 5
 Group:   System/Libraries
 License: SAMSUNG
 Source0: %{name}-%{version}.tar.gz
@@ -110,15 +110,13 @@ echo cmake . -DPREFIX=%{_prefix} \
         -DLIBDIR=%{_libdir} \
         -DINCLUDEDIR=%{_includedir} \
         -DCMAKE_BUILD_TYPE=%{build_type} \
-        -DVERSION=%{version} \
-        -DDPL_LOG="ON" 
+        -DVERSION=%{version} 
 cmake . -DPREFIX=%{_prefix} \
         -DEXEC_PREFIX=%{_exec_prefix} \
         -DLIBDIR=%{_libdir} \
         -DINCLUDEDIR=%{_includedir} \
         -DCMAKE_BUILD_TYPE=%{build_type} \
-        -DVERSION=%{version} \
-        -DDPL_LOG="ON" 
+        -DVERSION=%{version} 
 make %{?jobs:-j%jobs}
 
 %install
index c325b511a05c3f6a749168bf8b1c7f4ca4e570bd..72a37900ea248fe993a4ef51c8c8a548b3128f41 100644 (file)
@@ -105,7 +105,7 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char* packageId)
        destroy_char_list(ppPrivilegeList, privilegeList.size() + 1);
        if (ret != PRIV_MGR_ERROR_SUCCESS)
        {
-               LOGD("Failed to install privacy : %d", ret);
+               LOGD("Failed to install privacy info: %d", ret);
                return -EINVAL;
        }
 
@@ -123,12 +123,12 @@ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char* packageId)
        int res = privacy_manager_client_uninstall_privacy_by_server(packageId);
        if (res != PRIV_MGR_ERROR_SUCCESS)
        {
-               LOGD("Failed to uninstall privacy in server: %d", res);
+               LOGD("Failed to uninstall privacy info in server: %d", res);
                
                res = privacy_manager_client_uninstall_privacy(packageId);
                if (res != PRIV_MGR_ERROR_SUCCESS)
                {
-                       LOGD("Failed to uninstall privacy: %d", res);
+                       LOGD("Failed to uninstall privacy info: %d", res);
                        return -EINVAL;
                }
        }
@@ -136,3 +136,23 @@ int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char* packageId)
        LOGI("leave");
        return 0;
 }
+
+extern "C"
+__attribute__ ((visibility("default")))
+int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char* packageId)
+{
+       int res = 0;
+
+       res = PKGMGR_PARSER_PLUGIN_UNINSTALL(docPtr, packageId);
+       if (res != 0)
+       {
+               LOGD("Privacy info can be already uninstalled");
+       }
+
+       res = PKGMGR_PARSER_PLUGIN_INSTALL(docPtr, packageId);
+       if (res != 0)
+       {
+               LOGD("Failed to install privacy Info: %d", res);
+       }
+       return res;
+}
\ No newline at end of file