Fix StepCopyBackup 42/287042/1
authorilho kim <ilho159.kim@samsung.com>
Thu, 19 Jan 2023 04:42:20 +0000 (13:42 +0900)
committerilho kim <ilho159.kim@samsung.com>
Thu, 19 Jan 2023 04:42:20 +0000 (13:42 +0900)
The operation of creating shared res directory
should be performed in NewContent, not Backup

Change-Id: Ie8eac77d94b9db6466fdfdb65f0e1be1a9aba763
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
src/common/step/backup/step_copy_backup.cc

index 82d98e4..09a2252 100644 (file)
@@ -184,11 +184,6 @@ bool StepCopyBackup::Backup() {
       return false;
   }
 
-  if (ShouldBackupSharedRes()) {
-    if (!CreateSharedRes(backup_path_, context_->GetPkgPath()))
-      return false;
-  }
-
   AddRecoveryInfo();
 
   LOG(INFO) << "Old package context saved to: " << backup_path_;
@@ -242,6 +237,11 @@ bool StepCopyBackup::NewContent() {
     return false;
   }
 
+  if (ShouldBackupSharedRes()) {
+    if (!CreateSharedRes(backup_path_, context_->GetPkgPath()))
+      return false;
+  }
+
   for (bf::directory_iterator iter(context_->unpacked_dir_path.get());
        iter != bf::directory_iterator(); ++iter) {
     if (!Move(iter->path(), install_path_, FS_MERGE_SKIP))