From fbeebec15118bf5eced5af1e91cf7304edeeb03e Mon Sep 17 00:00:00 2001 From: ilho kim Date: Mon, 9 Jan 2023 11:49:49 +0900 Subject: [PATCH] Fix StepUpdateTep's undo If there is no tep before updating the tep directory itself must be removed at undo Change-Id: I6b8e395c9f7f7758d5eb85f38cd4cbdae12fb5c0 Signed-off-by: ilho kim --- src/common/step/filesystem/step_update_tep.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/step/filesystem/step_update_tep.cc b/src/common/step/filesystem/step_update_tep.cc index d8ad9cf..41b5117 100644 --- a/src/common/step/filesystem/step_update_tep.cc +++ b/src/common/step/filesystem/step_update_tep.cc @@ -85,7 +85,9 @@ Step::Status StepUpdateTep::clean() { } Step::Status StepUpdateTep::undo() { - RemoveAll(context_->tep_path.get()); + const bf::path& remove_path = context_->tep_path.get(); + RemoveAll(context_->old_manifest_data.get()->tep_name ? + remove_path : remove_path.parent_path()); return Status::OK; } -- 2.7.4