void AppInstaller::ReadonlyUpdateUninstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+ AddStep<ci::recovery::StepCreateRecoveryFile>();
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
ci::configuration::StepParseManifest::StoreLocation::BACKUP);
const char kRecoveryMountInstallString[] = "MOUNTINSTALL";
const char kRecoveryMountUpdateString[] = "MOUNTUPDATE";
const char kRecoveryReadonlyUpdateInstallString[] = "READONLYUPDATEINSTALL";
+const char kRecoveryReadonlyUpdateUninstallString[] = "READONLYUPDATEUNINSTALL";
const char kRecoveryUnknownString[] = "UNKNOWN";
const std::map<std::string, ci::RequestType> kStringToRequestMap = {
{kRecoveryMountUpdateString, ci::RequestType::MountUpdate},
{kRecoveryReadonlyUpdateInstallString,
ci::RequestType::ReadonlyUpdateInstall},
+ {kRecoveryReadonlyUpdateUninstallString,
+ ci::RequestType::ReadonlyUpdateUninstall},
};
std::string TruncateNewLine(const char* data) {
case RequestType::ReadonlyUpdateInstall:
ofs << kRecoveryReadonlyUpdateInstallString << std::endl;
break;
+ case RequestType::ReadonlyUpdateUninstall:
+ ofs << kRecoveryReadonlyUpdateUninstallString << std::endl;
+ break;
default:
ofs << kRecoveryUnknownString << std::endl;
break;
case ci::RequestType::Delta:
case ci::RequestType::MountUpdate:
case ci::RequestType::ReadonlyUpdateInstall:
+ case ci::RequestType::ReadonlyUpdateUninstall:
return ci::Plugin::ActionType::RecoverUpgrade;
default:
LOG(ERROR) << "Invalid request type : " << static_cast<int>(type);
context_->root_application_path.set(
GetRootAppPath(true, context_->uid.get()));
break;
+ case RequestType::ReadonlyUpdateUninstall:
+ LOG(INFO) << "Running recovery for readonly update uninstallation";
+ context_->request_type.set(RequestType::RecoveryUpdate);
+ context_->is_readonly_package.set(true);
+ context_->root_application_path.set(
+ GetRootAppPath(true, context_->uid.get()));
+ break;
default:
LOG(ERROR) << context_->file_path.get() << " is unknown recovery type ("
<< static_cast<int>(recovery_file->type()) << ")";
return RecoveryMountUpdate();
case RequestType::ReadonlyUpdateInstall:
return RecoveryReadonlyUpdateInstall();
+ case RequestType::ReadonlyUpdateUninstall:
+ return RecoveryReadonlyUpdateUninstall();
default:
LOG(ERROR) << "Recovery is not supported for given type of installation";
return Status::RECOVERY_ERROR;
return RecoveryUpdate();
}
+Step::Status StepRecovery::RecoveryReadonlyUpdateUninstall() {
+ return RecoveryReadonlyUpdateInstall();
+}
+
Step::Status StepRecovery::Cleanup() {
return Status::OK;
}
virtual Status RecoveryMountNew();
virtual Status RecoveryMountUpdate();
virtual Status RecoveryReadonlyUpdateInstall();
+ virtual Status RecoveryReadonlyUpdateUninstall();
virtual Status Cleanup();
};