implement pkg move 23/64123/5 accepted/tizen/common/20160421.161455 accepted/tizen/ivi/20160421.011258 accepted/tizen/mobile/20160421.011434 accepted/tizen/tv/20160421.011320 accepted/tizen/wearable/20160421.011326 submit/tizen/20160418.112441 submit/tizen/20160420.102539 submit/tizen/20160425.022839
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 30 Mar 2016 07:13:57 +0000 (16:13 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 18 Apr 2016 11:23:00 +0000 (04:23 -0700)
changes are applied in these repos
[pkgmgr-tool] https://review.tizen.org/gerrit/#/c/64121/
[slp-pkgmgr] https://review.tizen.org/gerrit/#/c/64122/
[pkgmgr-server] https://review.tizen.org/gerrit/#/c/64123/

Change-Id: I34e4d9ea0e3d8aea86681d34391d353916e4708d
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/pkgmgr-server.c
src/request.c

index f4e3463..05f3460 100644 (file)
@@ -904,7 +904,6 @@ static int __process_move(pm_dbus_msg *item)
        if (backend_cmd == NULL)
                return -1;
 
-       /* TODO: set movetype */
        snprintf(args, sizeof(args), "%s -k %s -m %s -t %s", backend_cmd,
                        item->req_id, item->pkgid, item->args);
        argv = __generate_argv(args);
index a9a2e5d..bd7e3f5 100644 (file)
@@ -41,8 +41,8 @@ static const char instropection_xml[] =
        "      <arg type='u' name='uid' direction='in'/>"
        "      <arg type='s' name='pkgtype' direction='in'/>"
        "      <arg type='s' name='pkgid' direction='in'/>"
+       "      <arg type='i' name='movetype' direction='in'/>"
        "      <arg type='i' name='ret' direction='out'/>"
-       "      <arg type='s' name='reqkey' direction='out'/>"
        "    </method>"
        "    <method name='enable_pkg'>"
        "      <arg type='u' name='uid' direction='in'/>"
@@ -319,27 +319,31 @@ static int __handle_request_move(uid_t uid,
        char *pkgtype = NULL;
        char *pkgid = NULL;
        char *reqkey;
+       int move_type = -1;
+       char buf[4] = { '\0' };
 
-       g_variant_get(parameters, "(u&s&s)", &target_uid, &pkgtype, &pkgid);
+       g_variant_get(parameters, "(u&s&si)", &target_uid, &pkgtype, &pkgid, &move_type);
        if (target_uid == (uid_t)-1 || pkgtype == NULL || pkgid == NULL) {
                g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(is)", PKGMGR_R_ECOMM, ""));
+                               g_variant_new("(i)", PKGMGR_R_ECOMM));
                return -1;
        }
 
        reqkey = __generate_reqkey(pkgid);
        if (reqkey == NULL)
                return -1;
+
+       snprintf(buf, sizeof(buf), "%d", move_type);
        if (_pm_queue_push(target_uid, reqkey, PKGMGR_REQUEST_TYPE_MOVE, pkgtype,
-                               pkgid, "")) {
+                               pkgid, buf)) {
                g_dbus_method_invocation_return_value(invocation,
-                               g_variant_new("(is)", PKGMGR_R_ESYSTEM, ""));
+                               g_variant_new("(i)", PKGMGR_R_ESYSTEM));
                free(reqkey);
                return -1;
        }
 
        g_dbus_method_invocation_return_value(invocation,
-                       g_variant_new("(is)", PKGMGR_R_OK, reqkey));
+                       g_variant_new("(i)", PKGMGR_R_OK));
        free(reqkey);
 
        return 0;