Update app root path when switching readonly mode 71/138171/9
authorSangyoon Jang <jeremy.jang@samsung.com>
Tue, 11 Jul 2017 10:23:01 +0000 (19:23 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 18 Jul 2017 03:08:35 +0000 (03:08 +0000)
Change-Id: I8d83e12fa1c511d0061a279235ca80a5a6b83751
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/step/configuration/step_switch_readonly_mode.cc
src/common/step/filesystem/step_remove_files.cc

index 3a73741..dd4f0bc 100644 (file)
@@ -10,6 +10,9 @@ namespace configuration {
 Step::Status StepSwitchReadonlyMode::process() {
   bool is_readonly_package = context_->is_readonly_package.get();
   context_->is_readonly_package.set(!is_readonly_package);
+  std::string root_app_path = GetRootAppPath(
+      context_->is_readonly_package.get(), context_->uid.get());
+  context_->root_application_path.set(root_app_path);
   return Status::OK;
 }
 
index 7c4a11b..b224e94 100644 (file)
@@ -61,7 +61,9 @@ Step::Status StepRemoveFiles::precheck() {
 }
 
 Step::Status StepRemoveFiles::process() {
-  bf::path pkg_path(context_->pkg_path.get());
+  // Use RootAppPath + Pkgid because of ReadonlyUpdateUninstall
+  bf::path pkg_path =
+      context_->root_application_path.get() / context_->pkgid.get();
 
   // We need to unmount external storage before removing package directory
   // because mount point is inside