From 15469a849ac22a6ac76f3e4fc01713a6036ca8ea Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Tue, 4 Aug 2015 13:54:47 +0200 Subject: [PATCH] Introduce recovery option to pkgmgr_installer Pkgmgr declares enum value for recovery installaton but there is no way for backend to run with this option as there is missing parsing in pkgmgr_installer_receive_request which backend is supposed to use. Adding processing -b option as PKGMGR_REQ_RECOVER in pkgmgr_installer API. Note: app-installers backends will expect invocation: backend -b /home/guest/apps_rw/recovery-%%%%%% where file is recovery file generated by interrupted installation process. Even the pkgmgr doesn't implements recovery now. App-installer needs any command line opton to run this mode when launched from commandline. Optional parameter of recovery mode is recovery file but if pkgmgr will support recovery in future, it is supposed that this may change. This is set in this form for now. Change-Id: I970607adcb4465e93a84eb774a0d75504cd443d2 --- comm/pkgmgr_installer.c | 12 ++++++++++++ comm/pkgmgr_installer_config.h | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/comm/pkgmgr_installer.c b/comm/pkgmgr_installer.c index 17f400c..feda92c 100644 --- a/comm/pkgmgr_installer.c +++ b/comm/pkgmgr_installer.c @@ -337,6 +337,18 @@ pkgmgr_installer_receive_request(pkgmgr_installer *pi, pi->pkgmgr_info = strndup(optarg, MAX_STRLEN); break; + case 'b': /* recovery */ + if (mode) { + r = -EINVAL; + goto RET; + } + mode = 'b'; + pi->request_type = PKGMGR_REQ_RECOVER; + if (pi->pkgmgr_info) + free(pi->pkgmgr_info); + pi->pkgmgr_info = strndup(optarg, MAX_STRLEN); + break; + /* Otherwise */ case '?': /* Not an option */ break; diff --git a/comm/pkgmgr_installer_config.h b/comm/pkgmgr_installer_config.h index babc364..8d61a30 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:q"; +const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:q"; const struct option long_opts[] = { { "session-id", 1, NULL, 'k' }, { "license-path", 1, NULL, 'l' }, @@ -48,6 +48,7 @@ const struct option long_opts[] = { { "tep-move", 1, NULL, 'M' }, { "smack", 1, NULL, 's' }, { "direct-manifest-install", 1, NULL, 'y' }, + { "recovery", 1, NULL, 'b' }, { 0, 0, 0, 0 } /* sentinel */ }; -- 2.7.4