From 5382bd989e0a34e8d3fbe9a3072e914ca0d26df7 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Thu, 28 Nov 2019 20:14:24 +0900 Subject: [PATCH] Change duplicated step name Same step name exists on tpk-backend Change-Id: Ia96de025c403f19af3deca55f9ff669a863d0092 Signed-off-by: Junghyun Yeon --- src/hybrid/hybrid_installer.cc | 28 +++++++++++----------- ...ic_link.cc => step_create_wgt_symbolic_link.cc} | 21 +++++++++++----- ...olic_link.h => step_create_wgt_symbolic_link.h} | 12 +++++----- src/wgt/wgt_installer.cc | 14 +++++------ 4 files changed, 42 insertions(+), 33 deletions(-) rename src/wgt/step/filesystem/{step_create_symbolic_link.cc => step_create_wgt_symbolic_link.cc} (79%) rename src/wgt/step/filesystem/{step_create_symbolic_link.h => step_create_wgt_symbolic_link.h} (75%) diff --git a/src/hybrid/hybrid_installer.cc b/src/hybrid/hybrid_installer.cc index fc7824f..2f00998 100644 --- a/src/hybrid/hybrid_installer.cc +++ b/src/hybrid/hybrid_installer.cc @@ -79,7 +79,7 @@ #include #include -#include +#include #include #include #include @@ -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(); AddStep( ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); @@ -214,8 +214,8 @@ void HybridInstaller::UpdateSteps() { AddStep(); AddStep( ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); @@ -309,8 +309,8 @@ void HybridInstaller::DeltaSteps() { AddStep(); AddStep( ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); AddStep( @@ -383,8 +383,8 @@ void HybridInstaller::MountInstallSteps() { AddStep(); AddStep( ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL); @@ -441,8 +441,8 @@ void HybridInstaller::MountUpdateSteps() { AddStep(); AddStep( ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); @@ -663,8 +663,8 @@ void HybridInstaller::ReadonlyUpdateInstallSteps() { AddStep(); AddStep( ci::security::StepPrivilegeCompatibility::InternalPrivType::BOTH); - AddStep(); - AddStep(); + AddStep(); + AddStep(); AddStep(); AddStep( ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE); diff --git a/src/wgt/step/filesystem/step_create_symbolic_link.cc b/src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc similarity index 79% rename from src/wgt/step/filesystem/step_create_symbolic_link.cc rename to src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc index c1091d0..d234494 100644 --- a/src/wgt/step/filesystem/step_create_symbolic_link.cc +++ b/src/wgt/step/filesystem/step_create_wgt_symbolic_link.cc @@ -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 #include @@ -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(context_->manifest_data.get()->application)) { + GListRange(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(context_->manifest_data.get()->application)) { + GListRange(context_->manifest_data.get()->application)) { bf::path exec_path = context_->GetPkgPath() / "bin" / app->appid; common_installer::RemoveAll(exec_path); } diff --git a/src/wgt/step/filesystem/step_create_symbolic_link.h b/src/wgt/step/filesystem/step_create_wgt_symbolic_link.h similarity index 75% rename from src/wgt/step/filesystem/step_create_symbolic_link.h rename to src/wgt/step/filesystem/step_create_wgt_symbolic_link.h index c1129e7..8f8e326 100644 --- a/src/wgt/step/filesystem/step_create_symbolic_link.h +++ b/src/wgt/step/filesystem/step_create_wgt_symbolic_link.h @@ -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 @@ -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_ diff --git a/src/wgt/wgt_installer.cc b/src/wgt/wgt_installer.cc index 2031f14..2187656 100644 --- a/src/wgt/wgt_installer.cc +++ b/src/wgt/wgt_installer.cc @@ -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(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(true); AddStep(); AddStep(); @@ -204,7 +204,7 @@ void WgtInstaller::UpdateSteps() { AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(true); AddStep(); AddStep(); @@ -322,7 +322,7 @@ void WgtInstaller::DeltaSteps() { AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(true); AddStep(); AddStep(); @@ -391,7 +391,7 @@ void WgtInstaller::MountInstallSteps() { AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(true); AddStep(); AddStep(); @@ -442,7 +442,7 @@ void WgtInstaller::MountUpdateSteps() { AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(true); AddStep(); AddStep(); @@ -560,7 +560,7 @@ void WgtInstaller::ReadonlyUpdateInstallSteps() { AddStep(); AddStep(); AddStep(); - AddStep(); + AddStep(); AddStep(true); AddStep(); AddStep(); -- 2.7.4