#include <pkgmgrinfo_basic.h>
+#include "common/utils/file_util.h"
#include "common/utils/paths.h"
#include "common/tzip_interface.h"
#include "common/zip_interface.h"
return Status::OK;
}
+Step::Status StepMountRecover::Cleanup() {
+ recovery::RecoveryFile* recovery_file =
+ context_->recovery_info.get().recovery_file.get();
+ if (!recovery_file) {
+ LOG(ERROR) << "Failed to get recovery info";
+ return Status::RECOVERY_ERROR;
+ }
+
+ if (recovery_file->type() != RequestType::MountUpdate)
+ return Status::OK;
+
+ bf::path zip_destination_path =
+ GetZipPackageLocation(context_->GetPkgPath(), context_->pkgid.get());
+ bf::path backup_zip_location = GetBackupPathForZipFile(zip_destination_path);
+
+ if (bf::exists(backup_zip_location)) {
+ if (!Remove(backup_zip_location)) {
+ LOG(ERROR) << "Fail to remove backup zip location : "
+ << backup_zip_location;
+ return Status::RECOVERY_ERROR;
+ }
+ }
+
+ return Status::OK;
+}
+
Step::Status StepMountRecover::clean() {
recovery::RecoveryFile* recovery_file =
context_->recovery_info.get().recovery_file.get();