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;
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;