Change duplicated step name 29/218829/3
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 28 Nov 2019 11:14:24 +0000 (20:14 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 9 Dec 2019 00:09:37 +0000 (00:09 +0000)
Same step name exists on tpk-backend

Change-Id: Ia96de025c403f19af3deca55f9ff669a863d0092
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/hybrid/hybrid_installer.cc
src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc [moved from src/wgt/step/filesystem/step_create_symbolic_link.cc with 79% similarity]
src/wgt/step/filesystem/step_create_wgt_symbolic_link.h [moved from src/wgt/step/filesystem/step_create_symbolic_link.h with 75% similarity]
src/wgt/wgt_installer.cc

index fc7824f..2f00998 100644 (file)
@@ -79,7 +79,7 @@
 #include <common/step/security/step_register_trust_anchor.h>
 #include <common/step/security/step_unregister_trust_anchor.h>
 
-#include <tpk/step/filesystem/step_create_symbolic_link.h>
+#include <tpk/step/filesystem/step_create_tpk_symbolic_link.h>
 #include <tpk/step/filesystem/step_tpk_patch_icons.h>
 #include <tpk/step/filesystem/step_tpk_prepare_package_directory.h>
 #include <tpk/step/filesystem/step_tpk_update_package_directory.h>
@@ -98,7 +98,7 @@
 #include "wgt/step/configuration/step_set_old_signature_files_location.h"
 #include "wgt/step/encryption/step_remove_encryption_data.h"
 #include "wgt/step/filesystem/step_copy_preview_icons.h"
-#include "wgt/step/filesystem/step_create_symbolic_link.h"
+#include "wgt/step/filesystem/step_create_wgt_symbolic_link.h"
 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
 #include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
@@ -155,8 +155,8 @@ void HybridInstaller::InstallSteps() {
   AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
   AddStep<ci::security::StepRegisterTrustAnchor>(
       ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
@@ -214,8 +214,8 @@ void HybridInstaller::UpdateSteps() {
   AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
   AddStep<ci::security::StepRegisterTrustAnchor>(
       ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
@@ -309,8 +309,8 @@ void HybridInstaller::DeltaSteps() {
   AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<ci::security::StepRegisterTrustAnchor>(
       ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
   AddStep<ci::security::StepPrivacyPrivilege>(
@@ -383,8 +383,8 @@ void HybridInstaller::MountInstallSteps() {
   AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<ci::pkgmgr::StepRegisterApplication>();
   AddStep<ci::security::StepRegisterTrustAnchor>(
       ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
@@ -441,8 +441,8 @@ void HybridInstaller::MountUpdateSteps() {
   AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
   AddStep<ci::security::StepRegisterTrustAnchor>(
       ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
@@ -663,8 +663,8 @@ void HybridInstaller::ReadonlyUpdateInstallSteps() {
   AddStep<hybrid::configuration::StepMergeTpkPrivileges>();
   AddStep<ci::security::StepPrivilegeCompatibility>(
       ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH);
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
-  AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
+  AddStep<tpk::filesystem::StepCreateTpkSymbolicLink>();
   AddStep<ci::pkgmgr::StepUpdateApplication>();
   AddStep<ci::security::StepRegisterTrustAnchor>(
       ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
@@ -3,7 +3,7 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#include "wgt/step/filesystem/step_create_symbolic_link.h"
+#include "wgt/step/filesystem/step_create_wgt_symbolic_link.h"
 
 #include <pkgmgr-info.h>
 #include <unistd.h>
@@ -31,10 +31,10 @@ const char kWRTPath[] = "/usr/bin/wrt";
 namespace wgt {
 namespace filesystem {
 
-bool StepCreateSymbolicLink::CreateSymlinksForApps() {
+bool StepCreateWgtSymbolicLink::CreateSymlinksForApps() {
   boost::system::error_code error;
   for (application_x* app :
-       GListRange<application_x*>(context_->manifest_data.get()->application)) {
+      GListRange<application_x*>(context_->manifest_data.get()->application)) {
     // filter out non-wgt apps as this step is run for hybrid backend too
     if (strcmp("webapp", app->type) != 0)
       continue;
@@ -63,7 +63,16 @@ bool StepCreateSymbolicLink::CreateSymlinksForApps() {
   return true;
 }
 
-common_installer::Step::Status StepCreateSymbolicLink::process() {
+common_installer::Step::Status StepCreateWgtSymbolicLink::precheck() {
+  if (!context_->manifest_data.get()) {
+    LOG(ERROR) << "Manifest data empty";
+    return Status::ERROR;
+  }
+
+  return Status::OK;
+}
+
+common_installer::Step::Status StepCreateWgtSymbolicLink::process() {
   assert(context_->manifest_data.get());
 
   if (!CreateSymlinksForApps())
@@ -73,9 +82,9 @@ common_installer::Step::Status StepCreateSymbolicLink::process() {
   return Status::OK;
 }
 
-common_installer::Step::Status StepCreateSymbolicLink::undo() {
+common_installer::Step::Status StepCreateWgtSymbolicLink::undo() {
   for (application_x* app :
-       GListRange<application_x*>(context_->manifest_data.get()->application)) {
+      GListRange<application_x*>(context_->manifest_data.get()->application)) {
     bf::path exec_path = context_->GetPkgPath() / "bin" / app->appid;
     common_installer::RemoveAll(exec_path);
   }
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a apache 2.0 license that can be
 // found in the LICENSE file.
 
-#ifndef WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
-#define WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
+#ifndef WGT_STEP_FILESYSTEM_STEP_CREATE_WGT_SYMBOLIC_LINK_H_
+#define WGT_STEP_FILESYSTEM_STEP_CREATE_WGT_SYMBOLIC_LINK_H_
 
 #include <boost/filesystem.hpp>
 
@@ -19,7 +19,7 @@ namespace filesystem {
 /**
  * \brief Step that create symbolic link to application
  */
-class StepCreateSymbolicLink : public common_installer::Step {
+class StepCreateWgtSymbolicLink : public common_installer::Step {
  public:
   using Step::Step;
 
@@ -46,11 +46,11 @@ class StepCreateSymbolicLink : public common_installer::Step {
   Status undo() override;
 
   /**
-   * \brief Empty method
+   * \brief Check weather manifest data is empty or not
    *
    * \return Status::OK
    */
-  Status precheck() override { return Status::OK; }
+  Status precheck() override;
 
  private:
   bool CreateSymlinksForApps();
@@ -61,4 +61,4 @@ class StepCreateSymbolicLink : public common_installer::Step {
 }  // namespace filesystem
 }  // namespace wgt
 
-#endif  // WGT_STEP_FILESYSTEM_STEP_CREATE_SYMBOLIC_LINK_H_
+#endif  // WGT_STEP_FILESYSTEM_STEP_CREATE_WGT_SYMBOLIC_LINK_H_
index 2031f14..2187656 100644 (file)
@@ -99,7 +99,7 @@
 #include "wgt/step/encryption/step_encrypt_resources.h"
 #include "wgt/step/encryption/step_remove_encryption_data.h"
 #include "wgt/step/filesystem/step_copy_preview_icons.h"
-#include "wgt/step/filesystem/step_create_symbolic_link.h"
+#include "wgt/step/filesystem/step_create_wgt_symbolic_link.h"
 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
 #include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
@@ -151,7 +151,7 @@ void WgtInstaller::InstallSteps() {
   AddStep<ci::filesystem::StepCopy>();
   AddStep<ci::filesystem::StepCopyTep>();
   AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
   AddStep<wgt::filesystem::StepWgtPatchIcons>(true);
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<wgt::filesystem::StepCopyPreviewIcons>();
@@ -204,7 +204,7 @@ void WgtInstaller::UpdateSteps() {
   AddStep<ci::backup::StepCopyBackup>();
   AddStep<ci::filesystem::StepUpdateTep>();
   AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
   AddStep<wgt::filesystem::StepWgtPatchIcons>(true);
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<wgt::filesystem::StepCopyPreviewIcons>();
@@ -322,7 +322,7 @@ void WgtInstaller::DeltaSteps() {
   AddStep<ci::backup::StepCopyBackup>();
   AddStep<ci::filesystem::StepUpdateTep>();
   AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
   AddStep<wgt::filesystem::StepWgtPatchIcons>(true);
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<wgt::filesystem::StepCopyPreviewIcons>();
@@ -391,7 +391,7 @@ void WgtInstaller::MountInstallSteps() {
   AddStep<wgt::filesystem::StepWgtPreparePackageDirectory>();
   AddStep<ci::filesystem::StepCopyTep>();
   AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
   AddStep<wgt::filesystem::StepWgtPatchIcons>(true);
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<wgt::filesystem::StepCopyPreviewIcons>();
@@ -442,7 +442,7 @@ void WgtInstaller::MountUpdateSteps() {
   AddStep<wgt::filesystem::StepWgtUpdatePackageDirectory>();
   AddStep<ci::filesystem::StepUpdateTep>();
   AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
   AddStep<wgt::filesystem::StepWgtPatchIcons>(true);
   AddStep<ci::filesystem::StepCreateIcons>();
   AddStep<wgt::filesystem::StepCopyPreviewIcons>();
@@ -560,7 +560,7 @@ void WgtInstaller::ReadonlyUpdateInstallSteps() {
   AddStep<ci::filesystem::StepCopyTep>();
   AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
   AddStep<ci::filesystem::StepCreateStorageDirectories>();
-  AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+  AddStep<wgt::filesystem::StepCreateWgtSymbolicLink>();
   AddStep<wgt::filesystem::StepWgtPatchIcons>(true);
   AddStep<wgt::filesystem::StepCopyPreviewIcons>();
   AddStep<wgt::security::StepCheckExtensionPrivileges>();