All step's success are regarded as installation's success 90/225290/5
authorIlho Kim <ilho159.kim@samsung.com>
Tue, 18 Feb 2020 05:57:10 +0000 (14:57 +0900)
committerilho kim <ilho159.kim@samsung.com>
Tue, 24 Mar 2020 03:36:12 +0000 (03:36 +0000)
After all steps succeed, send finish signal and set recovery file's cleanup flag

Related:
 [app-installers] https://review.tizen.org/gerrit/#/c/platform/core/appfw/app-installers/+/223113/
 [tpk-backend] https://review.tizen.org/gerrit/#/c/platform/core/appfw/tpk-backend/+/223114/
 [wgt-backend] https://review.tizen.org/gerrit/#/c/platform/core/appfw/wgt-backend/+/223115/

Change-Id: Iaac1d3db7c4a8d5a3fdae68acb962945a09d6769
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/app_installer.cc
src/common/step/backup/step_copy_backup.cc
src/common/step/filesystem/step_update_storage_directories.cc

index 6b2035f91e5dbb05619a99b324f6ff18058adb45..6b529d45fdcdbeebaba2889cdd89934ab141ed59 100644 (file)
@@ -236,7 +236,15 @@ AppInstaller::Result AppInstaller::Run() {
       }
     } while (it-- != itStart);
     failure_logger->WriteLogToFile();
+    SendFinished(status);
   } else {
+    const auto& recovery_file =
+      context_->recovery_info.get().recovery_file;
+    if (recovery_file) {
+      recovery_file->set_cleanup(true);
+      recovery_file->WriteAndCommitFileContent();
+    }
+    SendFinished(status);
     do {
       if (it == itEnd)
         --it;
@@ -249,8 +257,6 @@ AppInstaller::Result AppInstaller::Run() {
   }
   sync();
 
-  SendFinished(status);
-
   if ((context_->installation_mode.get() == InstallationMode::OFFLINE) &&
       (ret == Result::ERROR)) {
     std::fstream info_file("/tmp/.preload_install_error",
index 163ed58aadc5bec298b6a916b40bd9239a965f46..fd81df46baa67fc72a3b23bbcafc59dc90ce8e4a 100644 (file)
@@ -96,11 +96,6 @@ Step::Status StepCopyBackup::process() {
 }
 
 Step::Status StepCopyBackup::clean() {
-  recovery::RecoveryFile* recovery_file =
-      context_->recovery_info.get().recovery_file.get();
-  recovery_file->set_cleanup(true);
-  recovery_file->WriteAndCommitFileContent();
-
   LOG(DEBUG) << "Remove Applications files backup directory";
   CleanBackupDirectory();
 
index c10685cccd3588e6c9fbe70ffcb6720eb64f6447..b7fd7f8705b58d406c48d5f184c644bbd2b074f7 100644 (file)
@@ -136,12 +136,6 @@ Step::Status StepUpdateStorageDirectories::process() {
 }
 
 Step::Status StepUpdateStorageDirectories::clean() {
-  recovery::RecoveryFile* recovery_file =
-    context_->recovery_info.get().recovery_file.get();
-  if (recovery_file) {
-    recovery_file->set_cleanup(true);
-    recovery_file->WriteAndCommitFileContent();
-  }
   if (mode_ == UpdateMode::NONE)
     return Status::OK;