From 33573ed7447a46057a97b9c81a19789afccd887c Mon Sep 17 00:00:00 2001 From: Bartlomiej Kunikowski Date: Thu, 20 Oct 2016 10:31:04 +0200 Subject: [PATCH] Fix for MountInstallationMode_Rollback_Hybrid Submit together : - https://review.tizen.org/gerrit/#/c/97900/ To verify run wgt-backend smoke test Change-Id: Ifb5412896b5e898547f05101f54021b186c11408 --- src/tpk/step/filesystem/step_tpk_update_package_directory.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tpk/step/filesystem/step_tpk_update_package_directory.cc b/src/tpk/step/filesystem/step_tpk_update_package_directory.cc index 650ef50..0ec0789 100644 --- a/src/tpk/step/filesystem/step_tpk_update_package_directory.cc +++ b/src/tpk/step/filesystem/step_tpk_update_package_directory.cc @@ -59,6 +59,15 @@ ci::Step::Status StepTpkUpdatePackageDirectory::RestoreDirectory( if (bf::exists(backup_path / entry)) { bf::path source = backup_path / entry; bf::path destination = context_->pkg_path.get() / entry; + if (bf::exists(destination)) { + bs::error_code error; + bf::remove_all(destination, error); + if (error) { + LOG(ERROR) << "Failed to remove restore destination path: " + << destination; + return Status::APP_DIR_ERROR; + } + } if (!ReplacePaths(source, destination)) return Status::APP_DIR_ERROR; } -- 2.7.4