Fix StepParseManifest with recovery type cleanup 58/321658/1
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 26 Feb 2025 06:02:32 +0000 (15:02 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Wed, 26 Mar 2025 07:23:46 +0000 (07:23 +0000)
In the recovery of cleanup type, the original manifest file, not the
manifest of the backup path should be parsed

Change-Id: Id7d3a4b517f835c846ee34417a76c22077044c87
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
(cherry picked from commit 59a0f25b59222249d796e0b7dff04b2ee25c766a)

src/common/step/configuration/step_parse_manifest.cc

index b843efa71477c4492e6b757033244aa9dfdce8d3..07e07181ed737882f3b1f0a9bf449a4bd2489765 100644 (file)
@@ -116,9 +116,13 @@ bool StepParseManifest::LocateConfigFile() {
       install_path += ".xml";
       fs::path backup_install_path =
           common_installer::GetBackupPathForManifestFile(install_path);
-      if (fs::exists(backup_install_path))
+      bool is_clean_up = false;
+      if (context_->recovery_info.get().recovery_file &&
+          context_->recovery_info.get().recovery_file->cleanup())
+        is_clean_up = true;
+      if (!is_clean_up && fs::exists(backup_install_path))
         manifest = backup_install_path;
-      else if (fs::exists(backup_path))
+      else if (!is_clean_up && fs::exists(backup_path))
         manifest = backup_path;
       else if (fs::exists(install_path))
         manifest = install_path;