Clean up files at extended storage when install failed 32/159432/2
authorSangyoon Jang <jeremy.jang@samsung.com>
Thu, 26 Oct 2017 03:36:36 +0000 (12:36 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 9 Nov 2017 02:04:07 +0000 (02:04 +0000)
Change-Id: I458c83f1683ffc07e5a8a7cf8e204a7be95c1806
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
src/common/step/filesystem/step_copy.cc

index 2708d6c..e3a921d 100644 (file)
@@ -100,8 +100,14 @@ Step::Status StepCopy::clean() {
 }
 
 Step::Status StepCopy::undo() {
-  if (context_->external_storage)
+  if (context_->external_storage) {
     context_->external_storage->Abort();
+  } else if (context_->storage.get() == Storage::EXTENDED) {
+    bf::path install_path =
+        bf::path(GetExtendedRootAppPath(context_->uid.get())) /
+            context_->pkgid.get();
+    RemoveAll(install_path);
+  }
 
   if (!RemoveAll(context_->pkg_path.get()))
     return Status::APP_DIR_ERROR;