Try to remove the location of the extract entry 21/281121/3
authorIlho Kim <ilho159.kim@samsung.com>
Tue, 13 Sep 2022 02:22:43 +0000 (11:22 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Tue, 13 Sep 2022 06:29:01 +0000 (15:29 +0900)
Because MountInstall is performed when there is no manifest
a file may exist in the extract entry path, so remove that

Related:
 [app-installers]https://review.tizen.org/gerrit/#/c/platform/core/appfw/app-installers/+/281054/

Change-Id: I26e93e345779df832b421758f99d9600aa5bde3a
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc

index 4e90b29..2439ded 100644 (file)
@@ -88,9 +88,12 @@ ci::Step::Status StepWgtPreparePackageDirectory::ExtractEntries() {
   }
 
   for (auto& entry : GetExtractEntries()) {
-    if (context_->request_type.get() == ci::RequestType::MountUpdate)
+    if (context_->request_type.get() == ci::RequestType::MountInstall) {
+      ci::RemoveAll(resource_path / entry);
+    } else if (context_->request_type.get() == ci::RequestType::MountUpdate) {
       if (!ci::BackupDir(resource_path, backup_path, entry))
         return Status::APP_DIR_ERROR;
+    }
 
     if (!ci::ExtractToTmpDir(context_->file_path.get().c_str(),
             resource_path.c_str(), entry)) {