The rpk package doesn't contain shared directory, we don't need to check
free space for backup this directory.
Change-Id: Ie9cd4b1743487b4ac240891bb6a56645f3941903
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
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;
}