Try to remove the location of the extract entry 55/281055/1
authorIlho Kim <ilho159.kim@samsung.com>
Thu, 8 Sep 2022 11:21:33 +0000 (20:21 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Thu, 8 Sep 2022 11:21:33 +0000 (20:21 +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: I23c6c90b4f73ec77fb288ce86cf9e1c9bf45883a
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/tpk/step/filesystem/step_tpk_prepare_package_directory.cc

index 74ff98308e3f35ed7e244f3c908bb961095eeac2..0241fbe70e1cecd5a516e4188302d13d4a3c5b41 100644 (file)
@@ -91,7 +91,9 @@ ci::Step::Status StepTpkPreparePackageDirectory::ExtractEntries() {
 
   for (auto& entry : tpk::GetExtractEntries()) {
     LOG(DEBUG) << "Extracting: " << entry;
-    if (context_->request_type.get() == ci::RequestType::MountUpdate) {
+    if (context_->request_type.get() == ci::RequestType::MountInstall) {
+      ci::RemoveAll(context_->GetPkgPath() / entry);
+    } else if (context_->request_type.get() == ci::RequestType::MountUpdate) {
       if (BackupDirectory(entry, backup_path) != Status::OK)
         return Status::APP_DIR_ERROR;
     }