Cleardata will not be handled by backend 91/105691/10
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 19 Dec 2016 08:39:16 +0000 (17:39 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 23 Dec 2016 00:28:57 +0000 (16:28 -0800)
- 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 <jungh.yeon@samsung.com>
src/common/external_storage.cc
src/common/pkgmgr_interface.cc
src/common/pkgmgr_signal.cc
src/common/request.h
src/common/step/configuration/step_configure.cc
src/common/step/filesystem/step_clear_data.cc [deleted file]
src/common/step/filesystem/step_clear_data.h [deleted file]

index 35722b3..61ee675 100644 (file)
@@ -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:
index 7026a91..5464bae 100644 (file)
@@ -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:
index a3834db..392566e 100644 (file)
@@ -26,7 +26,6 @@ const std::map<ci::RequestType, const char*> 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},
index 6b2abc1..8ef8e81 100644 (file)
@@ -18,7 +18,6 @@ enum class RequestType : int {
   Update,
   Uninstall,
   Reinstall,
-  Clear,
   Delta,
   Move,
   Recovery,
index 3c803ad..8384f98 100644 (file)
@@ -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 (file)
index 3d9b473..0000000
+++ /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 <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-#include <boost/system/error_code.hpp>
-
-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 (file)
index 16cf013..0000000
+++ /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 <manifest_parser/utils/logging.h>
-
-#include <string>
-
-#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_