summaryrefslogtreecommitdiff
path: root/installer
diff options
context:
space:
mode:
authorJunghyun Yeon <jungh.yeon@samsung.com>2020-05-29 16:11:28 +0900
committerJunghyun Yeon <jungh.yeon@samsung.com>2020-06-01 08:35:23 +0000
commitfaa4a6de7abdb0193d11ccba0dea40b5ea7bddcf (patch)
tree72ae64ade975252c45c975941d0b132a6beec7d4 /installer
parent44c8bfb43a858f893d19eafc50e1029c0832dbd9 (diff)
downloadslp-pkgmgr-faa4a6de7abdb0193d11ccba0dea40b5ea7bddcf.tar.gz
slp-pkgmgr-faa4a6de7abdb0193d11ccba0dea40b5ea7bddcf.tar.bz2
slp-pkgmgr-faa4a6de7abdb0193d11ccba0dea40b5ea7bddcf.zip
Add --recovery-cleanup option for installer
It indicates that certain recovery should be handled as recovery cleanup mode. Change-Id: I4c615cafb58ca66aedef7f155ed00790cf3b2064 Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
Diffstat (limited to 'installer')
-rw-r--r--installer/pkgmgr_installer.c12
-rw-r--r--installer/pkgmgr_installer.h35
2 files changed, 47 insertions, 0 deletions
diff --git a/installer/pkgmgr_installer.c b/installer/pkgmgr_installer.c
index d1278d3..6a30c92 100644
--- a/installer/pkgmgr_installer.c
+++ b/installer/pkgmgr_installer.c
@@ -62,6 +62,7 @@
#define OPTVAL_MIGRATE_EXTIMG 1006
#define OPTVAL_SKIP_CHECK_REFERENCE 1007
#define OPTVAL_RECOVER_DB 1008
+#define OPTVAL_RECOVERY_CLEANUP 1009
/* Supported options */
const char *short_opts = "k:l:i:d:c:m:t:o:r:p:s:b:e:M:y:u:w:D:A:qGS";
@@ -93,6 +94,7 @@ const struct option long_opts[] = {
{ "migrate-extimg", 1, NULL, OPTVAL_MIGRATE_EXTIMG },
{ "skip-check-reference", 0, NULL, OPTVAL_SKIP_CHECK_REFERENCE },
{ "recover-db", 1, NULL, OPTVAL_RECOVER_DB },
+ { "recovery-cleanup", 0, NULL, OPTVAL_RECOVERY_CLEANUP },
{ 0, 0, 0, 0 } /* sentinel */
};
@@ -117,6 +119,7 @@ struct pkgmgr_installer {
int debug_mode;
int skip_check_reference;
int skip_optimization;
+ int recovery_cleanup;
GDBusConnection *conn;
GHashTable *pkg_list;
GList *pkgs;
@@ -497,6 +500,9 @@ pkgmgr_installer_receive_request(pkgmgr_installer *pi,
pi->pkgmgr_info = strndup(optarg, MAX_STRLEN);
__parse_multiple_pkgs(pi, argc, argv);
break;
+ case OPTVAL_RECOVERY_CLEANUP:
+ pi->recovery_cleanup = 1;
+ break;
case 'k': /* session id */
if (pi->session_id)
free(pi->session_id);
@@ -835,6 +841,12 @@ API int pkgmgr_installer_get_skip_optimization(pkgmgr_installer *pi)
return pi->skip_optimization;
}
+API int pkgmgr_installer_get_recovery_cleanup(pkgmgr_installer *pi)
+{
+ CHK_PI_RET(PKGMGR_REQ_INVALID);
+ return pi->recovery_cleanup;
+}
+
API int pkgmgr_installer_send_app_uninstall_signal(pkgmgr_installer *pi,
const char *pkg_type,
const char *pkgid,
diff --git a/installer/pkgmgr_installer.h b/installer/pkgmgr_installer.h
index 87798df..aab8a2a 100644
--- a/installer/pkgmgr_installer.h
+++ b/installer/pkgmgr_installer.h
@@ -836,6 +836,41 @@ int main(int argc, char **argv)
int pkgmgr_installer_get_skip_optimization(pkgmgr_installer *pi);
/**
+ @brief Get recovery cleanup mode
+ @pre pkgmgr_installer_receive_request() must be called.
+ @post None
+ @see pkgmgr_installer_receive_request
+ @param[in] pi pkgmgr_installer object
+ @return Operation result
+ @retval 0 if a recovery cleanup flag has not set
+ @retval 1 if a recovery cleanup flag has set
+ @remark None
+ @code
+#include <pkgmgr_installer.h>
+int main(int argc, char **argv)
+{
+ pkgmgr_installer *pi;
+ int r = 0;
+ int recovery_cleanup = 0;
+
+ pi = pkgmgr_installer_new();
+ if(!pi) return -1;
+ if(pkgmgr_installer_receive_request(pi, argc, argv)) {
+ r = -1;
+ goto CLEANUP_RET;
+ }
+ recovery_cleanup = pkgmgr_installer_get_recovery_cleanup(pi);
+
+ // Do something...
+
+ pkgmgr_installer_free(pi);
+ return r;
+}
+ @endcode
+*/
+int pkgmgr_installer_get_recovery_cleanup(pkgmgr_installer *pi);
+
+/**
@brief Send a app status signal
@pre None
@post None