Fix update failure of rpk package
[platform/core/appfw/app-installers.git] / src / common / step / backup / step_copy_backup.cc
index 8a7c11d..73f8f8c 100644 (file)
@@ -70,7 +70,13 @@ Step::Status StepCopyBackup::precheck() {
   install_path_ = context_->GetPkgPath();
   backup_path_ = GetBackupPathForPackagePath(context_->GetPkgPath());
 
-  if (!CheckFreeSpace(backup_path_, install_path_ / "shared")) {
+  // We only "copy" shared dir for backup.
+  // So if there is no shared dir, we don't need to check free space.
+  bf::path shared_dir = install_path_ / "shared";
+  if (!bf::exists(shared_dir))
+    return Status::OK;
+
+  if (!CheckFreeSpace(backup_path_, shared_dir)) {
     LOG(ERROR) << "not enough space for backup";
     return Step::Status::OUT_OF_SPACE;
   }