Reduce number of arguments for PKGMGR_REQ_MANIFEST_DIRECT_INSTALL 44/56244/2 accepted/tizen/mobile/20160108.064849 accepted/tizen/tv/20160108.064909 accepted/tizen/wearable/20160108.064937 submit/tizen/20160108.020058
authorTomasz Iwanek <t.iwanek@samsung.com>
Mon, 21 Dec 2015 13:49:35 +0000 (14:49 +0100)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Fri, 8 Jan 2016 01:40:53 +0000 (17:40 -0800)
Only pkgid is needed.

Requires:
 - https://review.tizen.org/gerrit/55079

Change-Id: Idf7cee0d476e5a193868833249ed43662166927c

comm/pkgmgr_installer.c
comm/pkgmgr_installer.h
comm/pkgmgr_installer_config.h

index 378c603..b16e22b 100644 (file)
@@ -60,8 +60,6 @@ struct pkgmgr_installer {
        char *tep_path;
        int tep_move;
        int is_tep_included;
-       char *directory_path;
-       char *xml_path;
        GDBusConnection *conn;
 };
 
@@ -163,10 +161,6 @@ API int pkgmgr_installer_free(pkgmgr_installer *pi)
                free(pi->caller_pkgid);
        if (pi->tep_path)
                free(pi->tep_path);
-       if (pi->xml_path)
-               free(pi->xml_path);
-       if (pi->directory_path)
-               free(pi->directory_path);
 
        if (pi->conn) {
                g_dbus_connection_flush_sync(pi->conn, NULL, NULL);
@@ -321,13 +315,10 @@ pkgmgr_installer_receive_request(pkgmgr_installer *pi,
                        pi->optional_data = strndup(optarg, MAX_STRLEN);
                        break;
 
-               case 'y': /* directory path*/
+               case 'y': /* pkgid for direct manifest installation */
+                       mode = 'y';
                        pi->request_type = PKGMGR_REQ_MANIFEST_DIRECT_INSTALL;
-                       pi->directory_path = strndup(optarg, MAX_STRLEN);
-                       break;
-
-               case 'x': /* xml path*/
-                       pi->xml_path = strndup(optarg, MAX_STRLEN);
+                       pi->pkgmgr_info = strndup(optarg, MAX_STRLEN);
                        break;
 
                        /* Otherwise */
@@ -356,18 +347,6 @@ API const char *pkgmgr_installer_get_request_info(pkgmgr_installer *pi)
        return pi->pkgmgr_info;
 }
 
-API const char *pkgmgr_installer_get_directory_path(pkgmgr_installer *pi)
-{
-       CHK_PI_RET(PKGMGR_REQ_INVALID);
-       return pi->directory_path;
-}
-
-API const char *pkgmgr_installer_get_xml_path(pkgmgr_installer *pi)
-{
-       CHK_PI_RET(PKGMGR_REQ_INVALID);
-       return pi->xml_path;
-}
-
 API const char *pkgmgr_installer_get_tep_path(pkgmgr_installer *pi)
 {
        CHK_PI_RET(PKGMGR_REQ_INVALID);
index 725da61..6536153 100644 (file)
@@ -254,74 +254,6 @@ int main(int argc, char **argv)
 const char *pkgmgr_installer_get_request_info(pkgmgr_installer *pi);
 
 /**
-       @brief          Get directory path
-       @pre            pkgmgr_installer_receive_request() must be called.
-       @post           None
-       @see            pkgmgr_installer_receive_request
-       @param[in]      pi      pkgmgr_installer object
-       @return         Directory path if passed
-       @retval         NULL    on function failure
-       @remark         Returned string must not be modified.
-       @code
-#include <pkgmgr_installer.h>
-int main(int argc, char **argv)
-{
-       pkgmgr_installer *pi;
-       int r = 0;
-       char *dir_path = NULL;
-
-       pi = pkgmgr_installer_new();
-       if(!pi) return -1;
-       if(pkgmgr_installer_receive_request(pi, argc, argv)) {
-               r = -1;
-               goto CLEANUP_RET;
-       }
-       dir_path = (char *) pkgmgr_installer_get_directory_path(pi);
-
-       // Do something...
-
-       pkgmgr_installer_free(pi);
-       return r;
-}
-       @endcode
- */
-const char *pkgmgr_installer_get_directory_path(pkgmgr_installer *pi);
-
-/**
-       @brief          Get xml path
-       @pre            pkgmgr_installer_receive_request() must be called.
-       @post           None
-       @see            pkgmgr_installer_receive_request
-       @param[in]      pi      pkgmgr_installer object
-       @return         XML path if passed
-       @retval         NULL    on function failure
-       @remark         Returned string must not be modified.
-       @code
-#include <pkgmgr_installer.h>
-int main(int argc, char **argv)
-{
-       pkgmgr_installer *pi;
-       int r = 0;
-       char *xml_path = NULL;
-
-       pi = pkgmgr_installer_new();
-       if(!pi) return -1;
-       if(pkgmgr_installer_receive_request(pi, argc, argv)) {
-               r = -1;
-               goto CLEANUP_RET;
-       }
-       xml_path = (char *) pkgmgr_installer_get_xml_path(pi);
-
-       // Do something...
-
-       pkgmgr_installer_free(pi);
-       return r;
-}
-       @endcode
- */
-const char *pkgmgr_installer_get_xml_path(pkgmgr_installer *pi);
-
-/**
        @brief          Get TEP path
        @pre            pkgmgr_installer_receive_request() must be called.
        @post           None
index 27d3368..babc364 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
 #endif
 
 /* Supported options */
-const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:e:M:y:x:q";
+const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:e:M:y:q";
 const struct option long_opts[] = {
        { "session-id", 1, NULL, 'k' },
        { "license-path", 1, NULL, 'l' },
@@ -47,8 +47,7 @@ const struct option long_opts[] = {
        { "tep-path", 1, NULL, 'e' },
        { "tep-move", 1, NULL, 'M' },
        { "smack", 1, NULL, 's' },
-       { "directory", 1, NULL, 'y' },
-       { "xml-path", 1, NULL, 'x' },
+       { "direct-manifest-install", 1, NULL, 'y' },
        { 0, 0, 0, 0 }  /* sentinel */
 };