- Add routine which remove unnecessary file
- Change install location to internal when initialization
of external storage has failed, instead of install fail
Change-Id: Id4ae2ad3b06334770354fe991ab3531b451cd04f
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
if (!NewContent())
return Status::APP_DIR_ERROR;
+ RemoveContent();
+
return Status::OK;
}
return true;
}
+void StepCopyBackup::RemoveContent() {
+ if (context_->request_type.get() == RequestType::Update &&
+ !context_->external_storage && bf::exists(install_path_ / ".mmc")) {
+ LOG(WARNING) << "Remove unnecessary files for external storage";
+ bs::error_code error;
+ bf::remove((install_path_ / ".mmc"), error);
+ if (error)
+ LOG(WARNING) << "error while remove files";
+ }
+}
+
bool StepCopyBackup::NewContent() {
bs::error_code error;
bf::create_directories(install_path_.parent_path(), error);
private:
bool Backup();
bool NewContent();
+ void RemoveContent();
bool CleanBackupDirectory();
bool RollbackApplicationDirectory();
bool MoveMountPointContent(const boost::filesystem::path& from,
storage = Storage::INTERNAL;
} else {
LOG(ERROR) << "Cannot initialize external storage for updated package";
- return Status::APP_DIR_ERROR;
+ storage = Storage::INTERNAL;
}
}