{ActionType::Clean, "PKGMGR_CATEGORY_PARSER_PLUGIN_CLEAN"},
{ActionType::Undo, "PKGMGR_CATEGORY_PARSER_PLUGIN_UNDO"},
{ActionType::Removed, "PKGMGR_CATEGORY_PARSER_PLUGIN_REMOVED"},
+ {ActionType::CleanUp, "PKGMGR_CATEGORY_PARSER_PLUGIN_CLEANUP"},
};
auto pos = names.find(action);
{ActionType::Clean, "PKGMGR_MDPARSER_PLUGIN_CLEAN"},
{ActionType::Undo, "PKGMGR_MDPARSER_PLUGIN_UNDO"},
{ActionType::Removed, "PKGMGR_MDPARSER_PLUGIN_REMOVED"},
+ {ActionType::CleanUp, "PKGMGR_MDPARSER_PLUGIN_CLEANUP"},
};
auto pos = names.find(action);
RecoverInstall,
RecoverUpgrade,
RecoverUninstall,
- Removed
+ Removed,
+ CleanUp
};
enum class ProcessType { Pre, Main, Post };
{{ActionType::RecoverUninstall, ProcessType::Main}, "PKGMGR_PARSER_PLUGIN_RECOVERUNINSTALL"}, // NOLINT
{{ActionType::Clean, ProcessType::Main}, "PKGMGR_PARSER_PLUGIN_CLEAN"}, // NOLINT
{{ActionType::Undo, ProcessType::Main}, "PKGMGR_PARSER_PLUGIN_UNDO"}, // NOLINT
+ {{ActionType::CleanUp, ProcessType::Main}, "PKGMGR_PARSER_PLUGIN_CLEANUP"}, // NOLINT
{{ActionType::Install, ProcessType::Post}, "PKGMGR_PARSER_PLUGIN_POST_INSTALL"}, // NOLINT
{{ActionType::Upgrade, ProcessType::Post}, "PKGMGR_PARSER_PLUGIN_POST_UPGRADE"}, // NOLINT
{{ActionType::Uninstall, ProcessType::Post}, "PKGMGR_PARSER_PLUGIN_POST_UNINSTALL"}, // NOLINT
}
bool IsNeedToUseBackupManifest(ci::InstallerContext* context) {
- ci::RequestType type = context->recovery_info.get().recovery_file->type();
+ auto& recovery_file = context->recovery_info.get().recovery_file;
+ if (recovery_file->cleanup())
+ return false;
+
+ ci::RequestType type = recovery_file->type();
if (type == ci::RequestType::Update || type == ci::RequestType::Delta ||
type == ci::RequestType::MountUpdate)
return true;
namespace pkgmgr {
Step::Status StepRecoverParserPlugin::RecoveryNew() {
- return RecoverPlugin();
+ return RecoverPlugin(GetActionType(context_));
}
Step::Status StepRecoverParserPlugin::RecoveryUpdate() {
- return RecoverPlugin();
+ return RecoverPlugin(GetActionType(context_));
+}
+
+
+Step::Status StepRecoverParserPlugin::Cleanup() {
+ return RecoverPlugin(Plugin::ActionType::CleanUp);
}
-Step::Status StepRecoverParserPlugin::RecoverPlugin() {
+Step::Status StepRecoverParserPlugin::RecoverPlugin(
+ Plugin::ActionType action_type) {
if (!SetXmlPath()) {
LOG(ERROR) << "Failed to set xml path for plugin, but continue";
return Status::OK;
}
plugin_ =
- std::make_unique<StepRunParserPlugin>(context_, GetActionType(context_));
+ std::make_unique<StepRunParserPlugin>(context_, action_type);
if (plugin_->process() != Step::Status::OK) {
LOG(ERROR) << "Failed to execute plugin properly, but continue";
return Status::OK;
#include <memory>
#include "common/installer_context.h"
+#include "common/plugins/plugin.h"
#include "common/step/pkgmgr/step_run_parser_plugins.h"
#include "common/step/recovery/step_recovery.h"
Status RecoveryNew() override;
Status RecoveryUpdate() override;
+ Status Cleanup() override;
private:
- Status RecoverPlugin();
+ Status RecoverPlugin(Plugin::ActionType action_type);
bool SetXmlPath();
std::unique_ptr<StepRunParserPlugin> plugin_;