From 10b6c50c9e5604988201bb6003d04a16dec5c005 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Mon, 21 Dec 2015 14:49:35 +0100 Subject: [PATCH] Reduce number of arguments for PKGMGR_REQ_MANIFEST_DIRECT_INSTALL Only pkgid is needed. Requires: - https://review.tizen.org/gerrit/55079 Change-Id: Idf7cee0d476e5a193868833249ed43662166927c --- comm/pkgmgr_installer.c | 27 ++--------------- comm/pkgmgr_installer.h | 68 ------------------------------------------ comm/pkgmgr_installer_config.h | 5 ++-- 3 files changed, 5 insertions(+), 95 deletions(-) diff --git a/comm/pkgmgr_installer.c b/comm/pkgmgr_installer.c index 378c603..b16e22b 100644 --- a/comm/pkgmgr_installer.c +++ b/comm/pkgmgr_installer.c @@ -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); diff --git a/comm/pkgmgr_installer.h b/comm/pkgmgr_installer.h index 725da61..6536153 100644 --- a/comm/pkgmgr_installer.h +++ b/comm/pkgmgr_installer.h @@ -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 -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 -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 diff --git a/comm/pkgmgr_installer_config.h b/comm/pkgmgr_installer_config.h index 27d3368..babc364 100644 --- a/comm/pkgmgr_installer_config.h +++ b/comm/pkgmgr_installer_config.h @@ -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 */ }; -- 2.7.4