namespace common_installer {
bool RegisterAppInPkgmgr(manifest_x* manifest,
- const bf::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
return false;
int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_process_usr_manifest_x_for_installation(manifest,
- xml_path.c_str(), uid) :
- pkgmgr_parser_process_manifest_x_for_installation(manifest,
- xml_path.c_str());
+ pkgmgr_parser_process_usr_manifest_x_for_installation(manifest, uid) :
+ pkgmgr_parser_process_manifest_x_for_installation(manifest);
if (ret) {
LOG(ERROR) << "Failed to insert manifest into pkgmgr, error code=" << ret;
return false;
}
bool UpgradeAppInPkgmgr(manifest_x* manifest,
- const bf::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
return false;
int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest,
- xml_path.c_str(), uid) :
- pkgmgr_parser_process_manifest_x_for_upgrade(manifest, xml_path.c_str());
+ pkgmgr_parser_process_usr_manifest_x_for_upgrade(manifest, uid) :
+ pkgmgr_parser_process_manifest_x_for_upgrade(manifest);
if (ret != 0) {
LOG(ERROR) << "Failed to update manifest in pkgmgr, error code=" << ret;
}
bool UnregisterAppInPkgmgr(manifest_x* manifest,
- const bf::path& xml_path,
const std::string& pkgid,
uid_t uid,
RequestMode request_mode) {
int ret = request_mode != RequestMode::GLOBAL ?
- pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest,
- xml_path.c_str(), uid) :
- pkgmgr_parser_process_manifest_x_for_uninstallation(manifest,
- xml_path.c_str());
+ pkgmgr_parser_process_usr_manifest_x_for_uninstallation(manifest, uid) :
+ pkgmgr_parser_process_manifest_x_for_uninstallation(manifest);
if (ret) {
LOG(ERROR) << "Failed to delete manifest from pkgmgr, error code=" << ret;
return false;
* \brief Adapter interface for external PkgMgr module used for registering
* package into pkgmgr
*
- * \param xml_path path to generated xml
+ * \param manifest parsed manifest information
* \param pkgid package pkgid
* \param uid user id
* \param request_mode current request mode
* \return true if success
*/
bool RegisterAppInPkgmgr(manifest_x* manifest,
- const boost::filesystem::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
* \brief Adapter interface for external PkgMgr module used for upgrading
* package within pkgmgr
*
- * \param xml_path path to generated xml
+ * \param manifest parsed manifest information
* \param pkgid package pkgid
* \param cert_info certifciate info
* \param uid user id
* \return true if success
*/
bool UpgradeAppInPkgmgr(manifest_x* manifest,
- const boost::filesystem::path& xml_path,
const std::string& pkgid,
const CertificateInfo& cert_info,
uid_t uid,
* \brief Adapter interface for external PkgMgr module used for deregistering
* package into pkgmgr
*
- * \param xml_path path to generated xml
+ * \param manifest parsed manifest information
* \param pkgid package pkgid
* \param uid user id
* \param request_mode current request mode
* \return true if success
*/
bool UnregisterAppInPkgmgr(manifest_x* manifest,
- const boost::filesystem::path& xml_path,
const std::string& pkgid,
uid_t uid,
RequestMode request_mode);
if (!SetXmlPaths())
return Status::OK;
UnregisterAppInPkgmgr(context_->manifest_data.get(),
- context_->xml_path.get(),
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get());
LOG(ERROR) << "Some parameters are lacking";
return Status::ERROR;
}
- bf::path xml_path = bf::exists(context_->backup_xml_path.get()) ?
- context_->backup_xml_path.get() : context_->xml_path.get();
UnregisterAppInPkgmgr(context_->manifest_data.get(),
- xml_path,
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get());
if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
- xml_path,
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
namespace common_installer {
namespace pkgmgr {
-Step::Status StepRegisterApplication::precheck() {
- if (context_->xml_path.get().empty()) {
- LOG(ERROR) << "xml_path attribute is empty";
- return Step::Status::MANIFEST_NOT_FOUND;
- }
- if (!boost::filesystem::exists(context_->xml_path.get())) {
- LOG(ERROR) << "xml_path ("
- << context_->xml_path.get()
- << ") path does not exist";
- return Step::Status::MANIFEST_NOT_FOUND;
- }
-
- return Step::Status::OK;
-}
-
Step::Status StepRegisterApplication::process() {
if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
- context_->xml_path.get(),
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
Step::Status StepRegisterApplication::undo() {
if (!UnregisterAppInPkgmgr(context_->manifest_data.get(),
- context_->xml_path.get(),
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get())) {
Status process() override;
Status clean() override { return Status::OK; }
Status undo() override;
- Status precheck() override;
+ Status precheck() override { return Status::OK; }
STEP_NAME(RegisterApp)
};
}
if (!UnregisterAppInPkgmgr(context_->manifest_data.get(),
- context_->xml_path.get(),
context_->pkgid.get(),
context_->uid.get(),
context_->request_mode.get())) {
Step::Status StepUnregisterApplication::undo() {
if (!RegisterAppInPkgmgr(context_->manifest_data.get(),
- context_->backup_xml_path.get(),
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
namespace common_installer {
namespace pkgmgr {
-Step::Status StepUpdateApplication::precheck() {
- if (context_->xml_path.get().empty()) {
- LOG(ERROR) << "Xml path is empty";
- return Status::MANIFEST_NOT_FOUND;
- }
- return Status::OK;
-}
-
Step::Status StepUpdateApplication::process() {
if (!UpgradeAppInPkgmgr(context_->manifest_data.get(),
- context_->xml_path.get(),
context_->pkgid.get(),
context_->certificate_info.get(),
context_->uid.get(),
}
if (!UpgradeAppInPkgmgr(context_->old_manifest_data.get(),
- context_->backup_xml_path.get(),
context_->pkgid.get(), certificate_info,
context_->uid.get(),
context_->request_mode.get())) {
Status process() override;
Status clean() override { return Status::OK; }
Status undo() override;
- Status precheck() override;
+ Status precheck() override { return Status::OK; }
STEP_NAME(UpdateApplication)
};