From 7efd9652acd62864ee5b5120d7efebb499bc5ee9 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Tue, 5 Jan 2016 15:09:54 +0100 Subject: [PATCH] Add extra constructor for pkgmgr_installer for offline mode This API will be used by app-installer to install manifest while creating tizen image. Dbus is not available in that case. Change-Id: I49eaeee83153dd7d0941f31cfa58e0bfa44aa43f --- comm/pkgmgr_installer.c | 16 ++++++++++++++++ comm/pkgmgr_installer.h | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/comm/pkgmgr_installer.c b/comm/pkgmgr_installer.c index b16e22b..17f400c 100644 --- a/comm/pkgmgr_installer.c +++ b/comm/pkgmgr_installer.c @@ -146,6 +146,22 @@ API pkgmgr_installer *pkgmgr_installer_new(void) return pi; } +API pkgmgr_installer *pkgmgr_installer_offline_new(void) +{ + pkgmgr_installer *pi; + GError *err = NULL; + + pi = calloc(1, sizeof(struct pkgmgr_installer)); + if (pi == NULL) + return NULL; + + pi->tep_path = NULL; + pi->tep_move = 0; + pi->request_type = PKGMGR_REQ_INVALID; + + return pi; +} + API int pkgmgr_installer_free(pkgmgr_installer *pi) { CHK_PI_RET(-EINVAL); diff --git a/comm/pkgmgr_installer.h b/comm/pkgmgr_installer.h index 6536153..35ec690 100644 --- a/comm/pkgmgr_installer.h +++ b/comm/pkgmgr_installer.h @@ -118,6 +118,22 @@ pkgmgr_installer_free(pi); */ pkgmgr_installer *pkgmgr_installer_new(void); +/** + * @brief Create a pkgmgr_installer object in offline mode + * @pre None + * @post pkgmgr_installer object must be freed. + * @see pkgmgr_installer_free + * @return pkgmgr_installer object + * @retval NULL on failure creating an object + * @remark None +@code +#include +pkgmgr_installer *pi = pkgmgr_installer_offline_new(); +pkgmgr_installer_free(pi); +@endcode + */ +pkgmgr_installer *pkgmgr_installer_offline_new(void); + /** @brief Free a pkgmgr_installer object @pre pi must be a valid object. -- 2.34.1