In case update, installer create backup xml file
This backup file should be removed when run recovery with cleanup flag
Change-Id: If517d33729d83c2a7625621c0db17ec52a8fbebb
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
return Status::OK;
}
+Step::Status StepRecoverManifest::Cleanup() {
+ if (!SetXmlPaths()) {
+ LOG(DEBUG) << "Manifest recovery not needed";
+ return Status::OK;
+ }
+ if (bf::exists(context_->backup_xml_path.get())) {
+ if (!Remove(context_->backup_xml_path.get())) {
+ LOG(ERROR) << "Cannot remove backup manifest file";
+ return Status::RECOVERY_ERROR;
+ }
+ }
+ LOG(INFO) << "Manifest recovery done";
+ return Status::OK;
+}
+
bool StepRecoverManifest::SetXmlPaths() {
if (context_->pkgid.get().empty())
return false;
Status RecoveryNew() override;
Status RecoveryUpdate() override;
+ Status Cleanup() override;
private:
bool SetXmlPaths();