From 17ac9a6ce5e739c965e0ca324e3068524362f227 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Mon, 19 Dec 2016 17:39:16 +0900 Subject: [PATCH] Cleardata will not be handled by backend - Cleardata operation will be handled by pkg_cleardata - Remove features related with it Related changes: [pkgmgr-server] : https://review.tizen.org/gerrit/106486 [pkgmgr-tool] : https://review.tizen.org/gerrit/106485 [tpk-backend] : https://review.tizen.org/gerrit/106603 [wgt-backend] : https://review.tizen.org/gerrit/106601 Change-Id: I19664fa8841467395c236af9a3a63fd206ded02e Signed-off-by: Junghyun Yeon --- src/common/external_storage.cc | 1 - src/common/pkgmgr_interface.cc | 2 - src/common/pkgmgr_signal.cc | 1 - src/common/request.h | 1 - src/common/step/configuration/step_configure.cc | 3 -- src/common/step/filesystem/step_clear_data.cc | 51 ------------------------- src/common/step/filesystem/step_clear_data.h | 37 ------------------ 7 files changed, 96 deletions(-) delete mode 100644 src/common/step/filesystem/step_clear_data.cc delete mode 100644 src/common/step/filesystem/step_clear_data.h diff --git a/src/common/external_storage.cc b/src/common/external_storage.cc index 35722b3..61ee675 100644 --- a/src/common/external_storage.cc +++ b/src/common/external_storage.cc @@ -185,7 +185,6 @@ bool ExternalStorage::Initialize( case RequestType::Uninstall: ret = handle_->interface.client_usr_pre_uninstall(pkgid_.c_str(), uid_); break; - case RequestType::Clear: case RequestType::Reinstall: case RequestType::Recovery: case RequestType::ManifestDirectInstall: diff --git a/src/common/pkgmgr_interface.cc b/src/common/pkgmgr_interface.cc index 7026a91..5464bae 100644 --- a/src/common/pkgmgr_interface.cc +++ b/src/common/pkgmgr_interface.cc @@ -145,8 +145,6 @@ RequestType PkgMgrInterface::GetRequestType() const { } case PKGMGR_REQ_REINSTALL: return RequestType::Reinstall; - case PKGMGR_REQ_CLEAR: - return RequestType::Clear; case PKGMGR_REQ_RECOVER: return RequestType::Recovery; case PKGMGR_REQ_MOVE: diff --git a/src/common/pkgmgr_signal.cc b/src/common/pkgmgr_signal.cc index a3834db..392566e 100644 --- a/src/common/pkgmgr_signal.cc +++ b/src/common/pkgmgr_signal.cc @@ -26,7 +26,6 @@ const std::map kEventStr = { {ci::RequestType::Install, PKGMGR_INSTALLER_INSTALL_EVENT_STR}, {ci::RequestType::Recovery, PKGMGR_INSTALLER_INSTALL_EVENT_STR}, {ci::RequestType::Reinstall, PKGMGR_INSTALLER_UPGRADE_EVENT_STR}, - {ci::RequestType::Clear, PKGMGR_INSTALLER_CLEAR_EVENT_STR}, {ci::RequestType::Uninstall, PKGMGR_INSTALLER_UNINSTALL_EVENT_STR}, {ci::RequestType::PartialUninstall, PKGMGR_INSTALLER_UNINSTALL_EVENT_STR}, {ci::RequestType::Update, PKGMGR_INSTALLER_UPGRADE_EVENT_STR}, diff --git a/src/common/request.h b/src/common/request.h index 6b2abc1..8ef8e81 100644 --- a/src/common/request.h +++ b/src/common/request.h @@ -18,7 +18,6 @@ enum class RequestType : int { Update, Uninstall, Reinstall, - Clear, Delta, Move, Recovery, diff --git a/src/common/step/configuration/step_configure.cc b/src/common/step/configuration/step_configure.cc index 3c803ad..8384f98 100644 --- a/src/common/step/configuration/step_configure.cc +++ b/src/common/step/configuration/step_configure.cc @@ -75,9 +75,6 @@ Step::Status StepConfigure::process() { context_->pkgid.set(pkgmgr_->GetRequestInfo()); context_->file_path.set(kStrEmpty); break; - case RequestType::Clear: - context_->pkgid.set(pkgmgr_->GetRequestInfo()); - break; case RequestType::Delta: context_->unpacked_dir_path.set(kStrEmpty); context_->pkgid.set(kStrEmpty); diff --git a/src/common/step/filesystem/step_clear_data.cc b/src/common/step/filesystem/step_clear_data.cc deleted file mode 100644 index 3d9b473..0000000 --- a/src/common/step/filesystem/step_clear_data.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by an apache-2.0 license that can be -// found in the LICENSE file. - -#include "common/step/filesystem/step_clear_data.h" - -#include -#include -#include - -namespace bf = boost::filesystem; -namespace bs = boost::system; - -namespace { - -const char kDataDirectory[] = "data"; - -} // namespace - -namespace common_installer { -namespace filesystem { - -Step::Status StepClearData::precheck() { - if (context_->pkgid.get().empty()) { - LOG(ERROR) << "Pkgid is not set"; - return Status::INVALID_VALUE; - } - return Status::OK; -} - -Step::Status StepClearData::process() { - Status status = Status::OK; - context_->pkg_path.set( - context_->root_application_path.get() / context_->pkgid.get()); - bf::path data_directory = context_->pkg_path.get() / kDataDirectory; - for (auto iter = bf::directory_iterator(data_directory); - iter != bf::directory_iterator(); ++iter) { - bs::error_code error; - bf::remove_all(iter->path(), error); - if (error) { - LOG(ERROR) << "Failed to remove: " << iter->path(); - status = Status::APP_DIR_ERROR; - } - } - LOG(DEBUG) << "Removing files from " << data_directory << " finished"; - return status; -} - -} // namespace filesystem -} // namespace common_installer - diff --git a/src/common/step/filesystem/step_clear_data.h b/src/common/step/filesystem/step_clear_data.h deleted file mode 100644 index 16cf013..0000000 --- a/src/common/step/filesystem/step_clear_data.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved -// Use of this source code is governed by an apache-2.0 license that can be -// found in the LICENSE file. - -#ifndef COMMON_STEP_FILESYSTEM_STEP_CLEAR_DATA_H_ -#define COMMON_STEP_FILESYSTEM_STEP_CLEAR_DATA_H_ - -#include - -#include - -#include "common/installer_context.h" -#include "common/step/step.h" - -namespace common_installer { -namespace filesystem { - -/** - * \brief Step responsible removing data/ directory in pkgmgr clear request - * Used by WGT and TPK backend - */ -class StepClearData : public Step { - public: - using Step::Step; - - Status process() override; - Status undo() override { return Status::OK; } - Status clean() override { return Status::OK; } - Status precheck() override; - - STEP_NAME(ClearData) -}; - -} // namespace filesystem -} // namespace common_installer - -#endif // COMMON_STEP_FILESYSTEM_STEP_CLEAR_DATA_H_ -- 2.7.4