From c25e63dccd6d128f2b67e6e5b58c127e9e2d7bc9 Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Fri, 7 Oct 2016 09:52:36 +0200 Subject: [PATCH] Patch reinstall/RDS according to SDK behaviour Commit changes reinstall request argument. Now pkgid is expected instead of path to directory. What is more, if package manifest is not in the directory supplied by reinstall/RDS then it will be copied from install location. Application installer expects that SDK will put files into: - local installation: /home/$USERNAME/apps_rw/tmp/$PKGID/ - global installation: /opt/apps/tmp/$PKGID/ Requires: - https://review.tizen.org/gerrit/91412 Submit together: - https://review.tizen.org/gerrit/91430 - https://review.tizen.org/gerrit/91431 - https://review.tizen.org/gerrit/91432 Verification: - run smoke tests, - run reinstall from SDK, - run RDS from SDK. Change-Id: I5194dd0a850a62b8712d75e62676c4ee9eebab9f --- src/common/step/configuration/step_configure.cc | 6 ++++-- src/common/step/rds/step_rds_modify.cc | 4 ++-- src/common/step/rds/step_rds_modify.h | 10 ++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/common/step/configuration/step_configure.cc b/src/common/step/configuration/step_configure.cc index e42fec7..b736408 100644 --- a/src/common/step/configuration/step_configure.cc +++ b/src/common/step/configuration/step_configure.cc @@ -64,8 +64,10 @@ Step::Status StepConfigure::process() { context_->file_path.set(kStrEmpty); break; case RequestType::Reinstall: - context_->unpacked_dir_path.set(pkgmgr_->GetRequestInfo()); - context_->pkgid.set(kStrEmpty); + context_->unpacked_dir_path.set( + context_->root_application_path.get() / "tmp" / + pkgmgr_->GetRequestInfo()); + context_->pkgid.set(pkgmgr_->GetRequestInfo()); context_->file_path.set(kStrEmpty); break; case RequestType::Clear: diff --git a/src/common/step/rds/step_rds_modify.cc b/src/common/step/rds/step_rds_modify.cc index 4bf1734..63e4e48 100644 --- a/src/common/step/rds/step_rds_modify.cc +++ b/src/common/step/rds/step_rds_modify.cc @@ -50,7 +50,7 @@ Step::Status StepRDSModify::process() { } context_->pkg_path.set( context_->root_application_path.get() /context_->pkgid.get()); - bf::path install_path = GetAppPath(); + bf::path install_path = context_->pkg_path.get(); bf::path unzip_path = context_->unpacked_dir_path.get(); if (!AddFiles(unzip_path, install_path) || !ModifyFiles(unzip_path, install_path) || @@ -159,7 +159,7 @@ bool StepRDSModify::PerformBackup(std::string relative_path, if (backup_temp_dir_.empty()) return false; if (operation == Operation::DELETE || operation == Operation::MODIFY) { - bf::path app_path = GetAppPath(); + bf::path app_path = context_->pkg_path.get(); bf::path source_path = app_path / relative_path; if (bf::is_directory(source_path)) { if (!CreateDir(backup_temp_dir_ / relative_path)) { diff --git a/src/common/step/rds/step_rds_modify.h b/src/common/step/rds/step_rds_modify.h index 26e3581..62e01d9 100644 --- a/src/common/step/rds/step_rds_modify.h +++ b/src/common/step/rds/step_rds_modify.h @@ -58,14 +58,6 @@ class StepRDSModify : public Step { */ Status precheck() override; - protected: - /** - * \brief Parse .rds_delta file - * - * \return std::string - */ - virtual std::string GetAppPath() = 0; - private: enum class Operation { ADD, @@ -88,6 +80,8 @@ class StepRDSModify : public Step { std::vector files_to_modify_; std::vector files_to_add_; std::vector files_to_delete_; + + STEP_NAME(RDSModify) }; } // namespace rds -- 2.7.4