diff options
author | Sangyoon Jang <jeremy.jang@samsung.com> | 2024-04-03 09:01:17 +0900 |
---|---|---|
committer | Sangyoon Jang <jeremy.jang@samsung.com> | 2024-04-03 09:01:17 +0900 |
commit | 99de126aa030582784f61890df9a60488f57dafb (patch) | |
tree | 40736addc6c5d546c251da23539b3b6cc15bfbc1 | |
parent | a5e4ef9c5cb617aef8dd3a668800da1b2025ac07 (diff) | |
download | app-installers-99de126aa030582784f61890df9a60488f57dafb.tar.gz app-installers-99de126aa030582784f61890df9a60488f57dafb.tar.bz2 app-installers-99de126aa030582784f61890df9a60488f57dafb.zip |
Fix clean undo operation of tag plugin
Pre/Post-clean/undo does not exist.
Change-Id: If40e883e418e4c37a6e4a7f605ad13f78995b69b
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
-rw-r--r-- | src/common/plugins/tag_plugin.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/common/plugins/tag_plugin.cc b/src/common/plugins/tag_plugin.cc index 7a248337..3fca08f5 100644 --- a/src/common/plugins/tag_plugin.cc +++ b/src/common/plugins/tag_plugin.cc @@ -105,12 +105,14 @@ bool TagPlugin::Run(xmlDocPtr doc_ptr, manifest_x* manifest, action_type != ActionType::Undo && action_type != ActionType::Clean) ? action_type_ : action_type; std::string pre_function = GetFunctionName(ProcessType::Pre, type); - Exec(pre_function, &result, manifest->package); - if (result) { - LOG(ERROR) << "Function: " << pre_function << " of plugin " - << plugin_info_.path() << " failed"; - xmlFreeDoc(plugin_doc_ptr); - return false; + if (!pre_function.empty()) { + Exec(pre_function, &result, manifest->package); + if (result) { + LOG(ERROR) << "Function: " << pre_function << " of plugin " + << plugin_info_.path() << " failed"; + xmlFreeDoc(plugin_doc_ptr); + return false; + } } std::string main_function = GetFunctionName(ProcessType::Main, type); @@ -123,12 +125,14 @@ bool TagPlugin::Run(xmlDocPtr doc_ptr, manifest_x* manifest, } std::string post_function = GetFunctionName(ProcessType::Post, type); - Exec(post_function, &result, manifest->package); - if (result) { - LOG(ERROR) << "Function: " << post_function << " of plugin " - << plugin_info_.path() << " failed"; - xmlFreeDoc(plugin_doc_ptr); - return false; + if (!post_function.empty()) { + Exec(post_function, &result, manifest->package); + if (result) { + LOG(ERROR) << "Function: " << post_function << " of plugin " + << plugin_info_.path() << " failed"; + xmlFreeDoc(plugin_doc_ptr); + return false; + } } xmlFreeDoc(plugin_doc_ptr); |