summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-02-15 03:00:37 (GMT)
committerSung-jae Park <nicesj.park@samsung.com>2013-02-15 03:00:37 (GMT)
commit7e19325259752ec58f4df731c2ca1d40c7a39300 (patch)
tree58194f23c2fd1f661e085c0a0ffee76704b1d5f2
parentf350fef4a102a3e0036f824e73bb3fa2cf542d81 (diff)
downloaddata-provider-master-7e19325259752ec58f4df731c2ca1d40c7a39300.zip
data-provider-master-7e19325259752ec58f4df731c2ca1d40c7a39300.tar.gz
data-provider-master-7e19325259752ec58f4df731c2ca1d40c7a39300.tar.bz2
Update the upgrade feature
Change-Id: Ibd2ebd56c3a2dcaf36155c9efcfd4b65571f431d
-rw-r--r--packaging/org.tizen.data-provider-master.spec2
-rw-r--r--pkgmgr_livebox/src/service_register.c59
2 files changed, 30 insertions, 31 deletions
diff --git a/packaging/org.tizen.data-provider-master.spec b/packaging/org.tizen.data-provider-master.spec
index 4986432..de0d650 100644
--- a/packaging/org.tizen.data-provider-master.spec
+++ b/packaging/org.tizen.data-provider-master.spec
@@ -1,6 +1,6 @@
Name: org.tizen.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
diff --git a/pkgmgr_livebox/src/service_register.c b/pkgmgr_livebox/src/service_register.c
index 1b15470..baefb2a 100644
--- a/pkgmgr_livebox/src/service_register.c
+++ b/pkgmgr_livebox/src/service_register.c
@@ -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;