From: Ilho Kim Date: Tue, 20 Aug 2019 08:16:31 +0000 (+0900) Subject: Add new install option X-Git-Tag: submit/tizen/20190822.055306~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=231e0ed90b3fa04e8897b687269c09c6ca19d57f;p=platform%2Fcore%2Fappfw%2Fpkgmgr-tool.git Add new install option This option will be used for fast installation without optimization Related changes [app-installers] https://review.tizen.org/gerrit/#/c/platform/core/appfw/app-installers/+/212328/ [pkgmgr-tool] https://review.tizen.org/gerrit/#/c/platform/core/appfw/pkgmgr-tool/+/212326/ [slp-pkgmgr] https://review.tizen.org/gerrit/#/c/platform/core/appfw/slp-pkgmgr/+/212327/ Change-Id: If850c33ca51769b7e968ec944b01d016e295aa5c Signed-off-by: Ilho Kim --- diff --git a/src/pkg_cmd.c b/src/pkg_cmd.c index 667d58b..0cca311 100644 --- a/src/pkg_cmd.c +++ b/src/pkg_cmd.c @@ -67,7 +67,7 @@ static int __convert_to_absolute_path(char *path); /* Supported options */ /* Note: 'G' is reserved */ -const char *short_options = "iurwmcgxCkaADL:lsd:p:t:n:T:e:M:X:Y:Z:qhG"; +const char *short_options = "iurwmcgxCkaADL:lsd:p:t:n:T:e:M:X:Y:Z:qhGS"; const struct option long_options[] = { {"install", 0, NULL, 'i'}, {"uninstall", 0, NULL, 'u'}, @@ -102,6 +102,7 @@ const struct option long_options[] = { {"debug-mode", 0, NULL, 'G'}, {"getsizeinfo", 0, NULL, 'x'}, {"uid", 1, NULL, OPTVAL_UID}, + {"skip-optimization", 0, NULL, 'S'}, {0, 0, 0, 0} /* sentinel */ }; @@ -150,6 +151,7 @@ struct pm_tool_args_t { int result; int uid; bool debug_mode; + bool skip_optimization; }; typedef struct pm_tool_args_t pm_tool_args; pm_tool_args data; @@ -439,6 +441,7 @@ static void __print_usage() printf("-G, --debug-mode install the package with debug mode for sdk\n"); printf("-D, --deactivate disable package or app\n"); printf("-A, --activate enable package or app\n"); + printf("-O, --skip-optimization install the package with skip optimization for sdk\n"); printf("-h, --help print this help\n"); printf("\n"); @@ -634,6 +637,9 @@ static int __install_req_dispatcher(uid_t target_uid) if (data.debug_mode) pkgmgr_client_set_debug_mode(pc, true); + if (data.skip_optimization) + pkgmgr_client_set_skip_optimization(pc, true); + if (data.tep_path[0] != '\0') pkgmgr_client_set_tep_path(pc, data.tep_path, data.tep_move); @@ -718,6 +724,9 @@ static int __reinstall_req_dispatcher(uid_t target_uid) if (data.debug_mode) pkgmgr_client_set_debug_mode(pc, true); + if (data.skip_optimization) + pkgmgr_client_set_skip_optimization(pc, true); + ret = pkgmgr_client_usr_reinstall(pc, NULL, data.pkgid, NULL, PM_QUIET, __return_cb, pc, target_uid); if (ret < 0) { @@ -752,6 +761,9 @@ static int __mount_install_req_dispatcher(uid_t target_uid) if (data.debug_mode) pkgmgr_client_set_debug_mode(pc, true); + if (data.skip_optimization) + pkgmgr_client_set_skip_optimization(pc, true); + if (data.tep_path[0] != '\0') pkgmgr_client_set_tep_path(pc, data.tep_path, data.tep_move); @@ -1636,6 +1648,10 @@ int main(int argc, char *argv[]) data.debug_mode = true; break; + case 'S': /* skip optimization */ + data.skip_optimization = true; + break; + /* Otherwise */ case '?': /* Not an option */ __print_usage();