namespace mount {
Step::Status StepMountUpdate::process() {
+ bs::error_code error;
+
+ if (!bf::exists(backup_path_)) {
+ bf::create_directories(backup_path_, error);
+ if (error) {
+ LOG(ERROR) << "Failed to create backup directory: " << backup_path_;
+ return Status::APP_DIR_ERROR;
+ }
+ }
+
auto zip_unpack = CreateZipInterface(context_->unpacked_dir_path.get());
if (!zip_unpack->UnmountZip()) {
LOG(ERROR) << "Failed to unmount zip package from temporary path";
context_->GetPkgPath(), context_->pkgid.get()));
Remove(backup_zip_location);
+ if (bf::exists(backup_path_))
+ RemoveAll(backup_path_);
+
return Status::OK;
}
return Status::APP_DIR_ERROR;
}
}
+
+ if (bf::exists(backup_path_))
+ RemoveAll(backup_path_);
+
return Status::OK;
}
return Step::Status::PACKAGE_NOT_FOUND;
}
+ backup_path_ = GetBackupPathForPackagePath(context_->GetPkgPath());
+
return Step::Status::OK;
}