upgrade package code is updated.
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 15 Feb 2013 02:43:39 +0000 (02:43 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Fri, 15 Feb 2013 02:43:39 +0000 (02:43 +0000)
Simply...

Change-Id: I262a2b95a3f0328d9c336f69aa674144442db118

packaging/com.samsung.data-provider-master.spec
pkgmgr_livebox/src/service_register.c

index 4bcf3d9..f390c6b 100644 (file)
@@ -1,6 +1,6 @@
 Name: com.samsung.data-provider-master
 Summary: Master service provider for liveboxes.
-Version: 0.16.3
+Version: 0.16.4
 Release: 1
 Group: framework/livebox
 License: Flora License
index 1b15470..baefb2a 100644 (file)
@@ -2382,36 +2382,6 @@ int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr docPtr, const char *appid)
        return 0;
 }
 
-int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char *appid)
-{
-       xmlNodePtr node;
-
-       if (!s_info.handle) {
-               if (db_init() < 0) {
-                       ErrPrint("Failed to init DB\n");
-                       return -EIO;
-               }
-       }
-
-       node = xmlDocGetRootElement(docPtr);
-       if (!node) {
-               ErrPrint("Invalid document\n");
-               return -EINVAL;
-       }
-
-       for (node = node->children; node; node = node->next) {
-               if (!xmlStrcasecmp(node->name, (const xmlChar *)"livebox"))
-                       break;
-       }
-
-       if (!node) {
-               ErrPrint("Root has no livebox\n");
-               return -EINVAL;
-       }
-
-       return 0;
-}
-
 static inline int do_uninstall(xmlNodePtr node, const char *appid)
 {
        xmlChar *pkgid;
@@ -2471,6 +2441,35 @@ errout:
        return ret;
 }
 
+int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr docPtr, const char *appid)
+{
+       xmlNodePtr node;
+       int ret;
+
+       if (!s_info.handle) {
+               if (db_init() < 0) {
+                       ErrPrint("Failed to init DB\n");
+                       return -EIO;
+               }
+       }
+
+       node = xmlDocGetRootElement(docPtr);
+       if (!node) {
+               ErrPrint("Invalid document\n");
+               return -EINVAL;
+       }
+
+       for (node = node->children; node; node = node->next) {
+               if (!xmlStrcasecmp(node->name, (const xmlChar *)"livebox")) {
+                       ret = do_uninstall(node, appid);
+                       ret = do_install(node, appid);
+                       DbgPrint("Returns: %d\n", ret);
+               }
+       }
+
+       return 0;
+}
+
 int PKGMGR_PARSER_PLUGIN_UNINSTALL(xmlDocPtr docPtr, const char *appid)
 {
        xmlNodePtr node;