Move step remove manifest to app-installer 33/59033/4
authorArkadiusz Szulakiewicz <a.szulakiewi@partner.samsung.com>
Mon, 8 Feb 2016 14:52:31 +0000 (15:52 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Wed, 10 Feb 2016 14:14:05 +0000 (06:14 -0800)
Requires:
https://review.tizen.org/gerrit/59034
https://review.tizen.org/gerrit/59035

Change-Id: I0ecb72b1b9ea005c7beef34e35cfcef4fb884b04

src/hybrid/hybrid_installer.cc
src/wgt/CMakeLists.txt
src/wgt/step/step_wgt_remove_manifest.cc [deleted file]
src/wgt/step/step_wgt_remove_manifest.h [deleted file]
src/wgt/wgt_installer.cc

index 0a88baf..48e693d 100644 (file)
@@ -38,6 +38,7 @@
 #include <common/step/step_unzip.h>
 #include <common/step/step_update_app.h>
 #include <common/step/step_update_security.h>
+#include <common/step/step_remove_manifest.h>
 
 #include <tpk/step/step_create_symbolic_link.h>
 #include <tpk/step/step_tpk_patch_icons.h>
@@ -55,7 +56,6 @@
 #include "wgt/step/step_remove_encryption_data.h"
 #include "wgt/step/step_wgt_patch_icons.h"
 #include "wgt/step/step_wgt_patch_storage_directories.h"
-#include "wgt/step/step_wgt_remove_manifest.h"
 
 namespace ci = common_installer;
 
@@ -141,7 +141,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::filesystem::StepRemoveIcons>();
       AddStep<wgt::encrypt::StepRemoveEncryptionData>();
       AddStep<ci::security::StepRevokeSecurity>();
-      AddStep<wgt::pkgmgr::StepRemoveManifest>();
+      AddStep<ci::pkgmgr::StepRemoveManifest>();
       break;
     case ci::RequestType::Reinstall:
       // RDS is not supported for hybrid apps
index 405d9e4..6cb1e7a 100644 (file)
@@ -14,7 +14,6 @@ SET(SRCS
   step/step_wgt_patch_icons.cc
   step/step_wgt_patch_storage_directories.cc
   step/step_wgt_resource_directory.cc
-  step/step_wgt_remove_manifest.cc
   step/step_add_default_privileges.cc
   wgt_app_query_interface.cc
   wgt_installer.cc
diff --git a/src/wgt/step/step_wgt_remove_manifest.cc b/src/wgt/step/step_wgt_remove_manifest.cc
deleted file mode 100644 (file)
index 68a982e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
-// Use of this source code is governed by a apache 2.0 license that can be
-// found in the LICENSE file.
-
-#include "wgt/step/step_wgt_remove_manifest.h"
-
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/system/error_code.hpp>
-
-#include <pkgmgr-info.h>
-#include <pkgmgr_installer.h>
-
-#include <algorithm>
-#include <string>
-
-#include "common/utils/file_util.h"
-
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
-
-namespace wgt {
-namespace pkgmgr {
-
-
-common_installer::Step::Status StepRemoveManifest::process() {
-  bs::error_code error;
-  bf::remove(context_->xml_path.get(), error);
-
-  if (error) {
-    LOG(ERROR) << "Failed to remove xml manifest file";
-    return Status::MANIFEST_ERROR;
-  }
-  LOG(DEBUG) << "Manifest file removed";
-  return Status::OK;
-}
-
-
-}  // namespace wgt
-}  // namespace pkgmgr
diff --git a/src/wgt/step/step_wgt_remove_manifest.h b/src/wgt/step/step_wgt_remove_manifest.h
deleted file mode 100644 (file)
index 459d633..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
-// Use of this source code is governed by a apache 2.0 license that can be
-// found in the LICENSE file.
-
-#ifndef WGT_STEP_STEP_WGT_REMOVE_MANIFEST_H_
-#define WGT_STEP_STEP_WGT_REMOVE_MANIFEST_H_
-
-#include <manifest_parser/utils/logging.h>
-
-#include "common/installer_context.h"
-#include "common/step/step.h"
-
-namespace wgt {
-namespace pkgmgr {
-
-/**
- * \brief Step responsbile for removing manifest file during uninstallation
- */
-class StepRemoveManifest : public common_installer::Step {
- public:
-  using common_installer::Step::Step;
-
-  /**
-   * \brief main logic of remove manifest
-   *
-   * \return Status::OK if success, Status::ERROR otherwise
-   */
-  Status process() override;
-
-  Status clean() override { return Status::OK; }
-  Status undo() override { return Status::OK; }
-  Status precheck() override { return Status::OK; }
-
-  SCOPE_LOG_TAG(RemoveManifest)
-};
-
-}  // namespace pkgmgr
-}  // namespace wgt
-
-#endif  // WGT_STEP_STEP_WGT_REMOVE_MANIFEST_H_
index 2397ebd..4eec68c 100644 (file)
@@ -41,9 +41,9 @@
 #include <common/step/step_update_app.h>
 #include <common/step/step_update_security.h>
 #include <common/step/step_check_old_certificate.h>
+#include <common/step/step_remove_manifest.h>
 
 #include <wgt_manifest_handlers/widget_config_parser.h>
-
 #include "wgt/step/step_add_default_privileges.h"
 #include "wgt/step/step_check_settings_level.h"
 #include "wgt/step/step_check_wgt_background_category.h"
@@ -58,7 +58,6 @@
 #include "wgt/step/step_wgt_patch_icons.h"
 #include "wgt/step/step_wgt_patch_storage_directories.h"
 #include "wgt/step/step_wgt_resource_directory.h"
-#include "wgt/step/step_wgt_remove_manifest.h"
 
 namespace ci = common_installer;
 
@@ -133,7 +132,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::filesystem::StepRemoveIcons>();
       AddStep<wgt::encrypt::StepRemoveEncryptionData>();
       AddStep<ci::security::StepRevokeSecurity>();
-      AddStep<wgt::pkgmgr::StepRemoveManifest>();
+      AddStep<ci::pkgmgr::StepRemoveManifest>();
       break;
     }
     case ci::RequestType::Reinstall: {