From: Pawel Sikorski Date: Fri, 27 Mar 2015 13:54:08 +0000 (+0100) Subject: Rename: X-Git-Tag: accepted/tizen/common/20150331.085109~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F20%2F37520%2F1;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Rename: * StepSecurity -> StepRegisterSecurity * StepSignature -> StepCheckSignature * StepRemove -> StepRemoveFiles * StepSymbolicLink -> StepCreateSymbolicLink * StepRecord -> StepRegisterApplication * StepUnregister -> StepUnregisterApplication Most of the steps contain verb and noun in their names. Hence, commit unifies all steps to follow this rule. Change-Id: I59114dc41385b16e4661e23cd38fcb65637289a3 --- diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 0e29938..566ce6c 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -5,16 +5,16 @@ SET(SRCS pkgmgr_signal.cc security_registration.cc step/step_unzip.cc - step/step_signature.cc + step/step_check_signature.cc step/step_copy.cc step/step_generate_xml.cc - step/step_record.cc + step/step_register_app.cc step/step_parse.cc - step/step_remove.cc + step/step_remove_files.cc step/step_revoke_security.cc - step/step_security.cc + step/step_register_security.cc step/step_signal.cc - step/step_unregister.cc + step/step_unregister_app.cc ) # Target - definition ADD_LIBRARY(${TARGET_LIBNAME_COMMON} SHARED ${SRCS}) diff --git a/src/common/step/step_signature.cc b/src/common/step/step_check_signature.cc similarity index 86% rename from src/common/step/step_signature.cc rename to src/common/step/step_check_signature.cc index 0dbd0d9..f8e90bd 100644 --- a/src/common/step/step_signature.cc +++ b/src/common/step/step_check_signature.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#include "common/step/step_signature.h" +#include "common/step/step_check_signature.h" #include @@ -15,7 +15,7 @@ namespace bf = boost::filesystem; namespace common_installer { namespace signature { -Step::Status StepSignature::process() { +Step::Status StepCheckSignature::process() { return (SignatureValidator::Check(bf::path(context_->unpacked_dir_path())) == SignatureValidator::INVALID) ? Status::ERROR : Status::OK; } diff --git a/src/common/step/step_signature.h b/src/common/step/step_check_signature.h similarity index 76% rename from src/common/step/step_signature.h rename to src/common/step/step_check_signature.h index 1cf5ce4..fd1b2e0 100644 --- a/src/common/step/step_signature.h +++ b/src/common/step/step_check_signature.h @@ -2,8 +2,8 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#ifndef COMMON_STEP_STEP_SIGNATURE_H_ -#define COMMON_STEP_STEP_SIGNATURE_H_ +#ifndef COMMON_STEP_STEP_CHECK_SIGNATURE_H_ +#define COMMON_STEP_STEP_CHECK_SIGNATURE_H_ #include "common/context_installer.h" #include "common/step/step.h" @@ -12,7 +12,7 @@ namespace common_installer { namespace signature { -class StepSignature : public Step { +class StepCheckSignature : public Step { public: using Step::Step; @@ -26,4 +26,4 @@ class StepSignature : public Step { } // namespace signature } // namespace common_installer -#endif // COMMON_STEP_STEP_SIGNATURE_H_ +#endif // COMMON_STEP_STEP_CHECK_SIGNATURE_H_ diff --git a/src/common/step/step_record.cc b/src/common/step/step_register_app.cc similarity index 91% rename from src/common/step/step_record.cc rename to src/common/step/step_register_app.cc index cd581a7..0db57a9 100644 --- a/src/common/step/step_record.cc +++ b/src/common/step/step_register_app.cc @@ -1,6 +1,6 @@ /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */ -#include "common/step/step_record.h" +#include "common/step/step_register_app.h" #include #include @@ -23,11 +23,11 @@ const char kPkgInitUser[] = "/usr/bin/pkg_initdb_user"; } // anonymous namespace namespace common_installer { -namespace record { +namespace register_app { namespace fs = boost::filesystem; -Step::Status StepRecord::process() { +Step::Status StepRegisterApplication::process() { assert(!context_->xml_path().empty()); const char* const appinst_tags[] = {"removable=true", nullptr, }; @@ -53,11 +53,11 @@ Step::Status StepRecord::process() { return Status::OK; } -Step::Status StepRecord::clean() { +Step::Status StepRegisterApplication::clean() { return Status::OK; } -Step::Status StepRecord::undo() { +Step::Status StepRegisterApplication::undo() { if (context_->uid() != tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)) { const char* ail_cmd[] = {kAilInitUser, nullptr}; const char* pkgmgr_cmd[] = {kPkgInitUser, nullptr}; @@ -88,5 +88,5 @@ Step::Status StepRecord::undo() { return Status::OK; } -} // namespace record +} // namespace register_app } // namespace common_installer diff --git a/src/common/step/step_record.h b/src/common/step/step_register_app.h similarity index 62% rename from src/common/step/step_record.h rename to src/common/step/step_register_app.h index fadeac4..fee4148 100644 --- a/src/common/step/step_record.h +++ b/src/common/step/step_register_app.h @@ -1,16 +1,16 @@ /* 2014, Copyright © Intel Coporation, license APACHE-2.0, see LICENSE file */ -#ifndef COMMON_STEP_STEP_RECORD_H_ -#define COMMON_STEP_STEP_RECORD_H_ +#ifndef COMMON_STEP_STEP_REGISTER_APP_H_ +#define COMMON_STEP_STEP_REGISTER_APP_H_ #include "common/context_installer.h" #include "common/step/step.h" #include "utils/logging.h" namespace common_installer { -namespace record { +namespace register_app { -class StepRecord : public Step { +class StepRegisterApplication : public Step { public: using Step::Step; @@ -21,8 +21,8 @@ class StepRecord : public Step { SCOPE_LOG_TAG(Record) }; -} // namespace record +} // namespace register_app } // namespace common_installer -#endif // COMMON_STEP_STEP_RECORD_H_ +#endif // COMMON_STEP_STEP_REGISTER_APP_H_ diff --git a/src/common/step/step_security.cc b/src/common/step/step_register_security.cc similarity index 84% rename from src/common/step/step_security.cc rename to src/common/step/step_register_security.cc index 12fdf26..1baf634 100644 --- a/src/common/step/step_security.cc +++ b/src/common/step/step_register_security.cc @@ -2,14 +2,14 @@ // Use of this source code is governed by a apache 2.0 license that can be // found in the LICENSE file. -#include "common/step/step_security.h" +#include "common/step/step_register_security.h" #include "common/security_registration.h" namespace common_installer { namespace security { -Step::Status StepSecurity::process() { +Step::Status StepRegisterSecurity::process() { if (!RegisterSecurityContextForApps( context_->pkgid(), context_->GetApplicationPath(), context_->manifest_data())) { @@ -19,7 +19,7 @@ Step::Status StepSecurity::process() { return Status::OK; } -Step::Status StepSecurity::undo() { +Step::Status StepRegisterSecurity::undo() { if (!UnregisterSecurityContextForApps( context_->pkgid(), context_->manifest_data())) { return Status::ERROR; diff --git a/src/common/step/step_security.h b/src/common/step/step_register_security.h similarity index 73% rename from src/common/step/step_security.h rename to src/common/step/step_register_security.h index 6e1fc72..0067688 100644 --- a/src/common/step/step_security.h +++ b/src/common/step/step_register_security.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 COMMON_STEP_STEP_SECURITY_H_ -#define COMMON_STEP_STEP_SECURITY_H_ +#ifndef COMMON_STEP_STEP_REGISTER_SECURITY_H_ +#define COMMON_STEP_STEP_REGISTER_SECURITY_H_ #include "common/step/step.h" #include "utils/logging.h" @@ -11,7 +11,7 @@ namespace common_installer { namespace security { -class StepSecurity : public Step { +class StepRegisterSecurity : public Step { public: using Step::Step; @@ -25,4 +25,4 @@ class StepSecurity : public Step { } // namespace security } // namespace common_installer -#endif // COMMON_STEP_STEP_SECURITY_H_ +#endif // COMMON_STEP_STEP_REGISTER_SECURITY_H_ diff --git a/src/common/step/step_remove.cc b/src/common/step/step_remove_files.cc similarity index 86% rename from src/common/step/step_remove.cc rename to src/common/step/step_remove_files.cc index e3761ab..1a8799f 100755 --- a/src/common/step/step_remove.cc +++ b/src/common/step/step_remove_files.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. -#include "common/step/step_remove.h" +#include "common/step/step_remove_files.h" #include @@ -16,7 +16,7 @@ namespace remove { namespace fs = boost::filesystem; -Step::Status StepRemove::process() { +Step::Status StepRemoveFiles::process() { uiapplication_x* ui = context_->manifest_data()->uiapplication; if (!fs::exists(context_->pkg_path())) @@ -37,11 +37,11 @@ Step::Status StepRemove::process() { return Status::OK; } -Step::Status StepRemove::clean() { +Step::Status StepRemoveFiles::clean() { return Status::OK; } -Step::Status StepRemove::undo() { +Step::Status StepRemoveFiles::undo() { return Status::OK; } diff --git a/src/common/step/step_remove.h b/src/common/step/step_remove_files.h similarity index 76% rename from src/common/step/step_remove.h rename to src/common/step/step_remove_files.h index ac79aed..7059973 100755 --- a/src/common/step/step_remove.h +++ b/src/common/step/step_remove_files.h @@ -2,8 +2,8 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#ifndef COMMON_STEP_STEP_REMOVE_H_ -#define COMMON_STEP_STEP_REMOVE_H_ +#ifndef COMMON_STEP_STEP_REMOVE_FILES_H_ +#define COMMON_STEP_STEP_REMOVE_FILES_H_ #include "common/context_installer.h" @@ -13,7 +13,7 @@ namespace common_installer { namespace remove { -class StepRemove : public Step { +class StepRemoveFiles : public Step { public: using Step::Step; @@ -27,4 +27,4 @@ class StepRemove : public Step { } // namespace remove } // namespace common_installer -#endif // COMMON_STEP_STEP_REMOVE_H_ +#endif // COMMON_STEP_STEP_REMOVE_FILES_H_ diff --git a/src/common/step/step_unregister.cc b/src/common/step/step_unregister_app.cc similarity index 82% rename from src/common/step/step_unregister.cc rename to src/common/step/step_unregister_app.cc index ca8c10e..642880b 100755 --- a/src/common/step/step_unregister.cc +++ b/src/common/step/step_unregister_app.cc @@ -8,15 +8,15 @@ #include #include -#include "common/step/step_unregister.h" +#include "common/step/step_unregister_app.h" #include "utils/file_util.h" namespace common_installer { -namespace unregister { +namespace unregister_app { namespace fs = boost::filesystem; -Step::Status StepUnregister::process() { +Step::Status StepUnregisterApplication::process() { assert(!context_->pkgid().empty()); const char* const appinst_tags[] = {"removable=true", nullptr, }; @@ -37,15 +37,15 @@ Step::Status StepUnregister::process() { return Status::OK; } -Step::Status StepUnregister::clean() { +Step::Status StepUnregisterApplication::clean() { LOG(DEBUG) << "Empty 'clean' method"; return Status::OK; } -Step::Status StepUnregister::undo() { +Step::Status StepUnregisterApplication::undo() { LOG(DEBUG) << "Empty 'undo' method"; return Status::OK; } -} // namespace unregister +} // namespace unregister_app } // namespace common_installer diff --git a/src/common/step/step_unregister.h b/src/common/step/step_unregister_app.h similarity index 67% rename from src/common/step/step_unregister.h rename to src/common/step/step_unregister_app.h index 7000f55..8707a9c 100755 --- a/src/common/step/step_unregister.h +++ b/src/common/step/step_unregister_app.h @@ -2,17 +2,17 @@ // Use of this source code is governed by an apache 2.0 license that can be // found in the LICENSE file. -#ifndef COMMON_STEP_STEP_UNREGISTER_H_ -#define COMMON_STEP_STEP_UNREGISTER_H_ +#ifndef COMMON_STEP_STEP_UNREGISTER_APP_H_ +#define COMMON_STEP_STEP_UNREGISTER_APP_H_ #include "common/context_installer.h" #include "common/step/step.h" #include "utils/logging.h" namespace common_installer { -namespace unregister { +namespace unregister_app { -class StepUnregister : public Step { +class StepUnregisterApplication : public Step { public: using Step::Step; @@ -23,8 +23,8 @@ class StepUnregister : public Step { SCOPE_LOG_TAG(Unregister) }; -} // namespace unregister +} // namespace unregister_app } // namespace common_installer -#endif // COMMON_STEP_STEP_UNREGISTER_H_ +#endif // COMMON_STEP_STEP_UNREGISTER_APP_H_ diff --git a/src/tpk/CMakeLists.txt b/src/tpk/CMakeLists.txt index da3fa9e..d16b5d1 100644 --- a/src/tpk/CMakeLists.txt +++ b/src/tpk/CMakeLists.txt @@ -8,7 +8,7 @@ SET(SRCS main.cc task.cc step/step_parse.cc - step/step_symbolic_link.cc + step/step_create_symbolic_link.cc ../xml_parser/xml_parser.cc ) ADD_EXECUTABLE(${TARGET_TPK} ${SRCS}) diff --git a/src/tpk/step/step_symbolic_link.cc b/src/tpk/step/step_create_symbolic_link.cc similarity index 94% rename from src/tpk/step/step_symbolic_link.cc rename to src/tpk/step/step_create_symbolic_link.cc index 38f1181..da52bd8 100644 --- a/src/tpk/step/step_symbolic_link.cc +++ b/src/tpk/step/step_create_symbolic_link.cc @@ -1,5 +1,5 @@ /* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */ -#include "tpk/step/step_symbolic_link.h" +#include "tpk/step/step_create_symbolic_link.h" #include #include #include "common/step/step.h" @@ -75,7 +75,7 @@ bool RemoveSymLink(T *app, ContextInstaller* context) { -Status StepSymbolicLink::process() { +Status StepCreateSymbolicLink::process() { // Get manifest_x manifest_x *m = context_->manifest_data(); if (!m) { @@ -97,12 +97,12 @@ Status StepSymbolicLink::process() { } -Status StepSymbolicLink::clean() { +Status StepCreateSymbolicLink::clean() { return Status::OK; } -Status StepSymbolicLink::undo() { +Status StepCreateSymbolicLink::undo() { manifest_x* m = context_->manifest_data(); uiapplication_x *uiapp = m->uiapplication; serviceapplication_x *svcapp = m->serviceapplication; diff --git a/src/tpk/step/step_symbolic_link.h b/src/tpk/step/step_create_symbolic_link.h similarity index 60% rename from src/tpk/step/step_symbolic_link.h rename to src/tpk/step/step_create_symbolic_link.h index cb16c55..084a8c8 100644 --- a/src/tpk/step/step_symbolic_link.h +++ b/src/tpk/step/step_create_symbolic_link.h @@ -1,13 +1,13 @@ /* Copyright 2015 Samsung Electronics, license APACHE-2.0, see LICENSE file */ -#ifndef TPK_STEP_STEP_SYMBOLIC_LINK_H_ -#define TPK_STEP_STEP_SYMBOLIC_LINK_H_ +#ifndef TPK_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ +#define TPK_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ #include "common/app_installer.h" namespace tpk { namespace step { -class StepSymbolicLink : public common_installer::Step { +class StepCreateSymbolicLink : public common_installer::Step { public: using Step::Step; Status process() override; @@ -18,4 +18,4 @@ class StepSymbolicLink : public common_installer::Step { } // namespace step } // namespace tpk -#endif // TPK_STEP_STEP_SYMBOLIC_LINK_H_ +#endif // TPK_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ diff --git a/src/tpk/task.cc b/src/tpk/task.cc index 53db317..dec4e99 100644 --- a/src/tpk/task.cc +++ b/src/tpk/task.cc @@ -8,16 +8,16 @@ #include "common/step/step_copy.h" #include "common/step/step_generate_xml.h" #include "common/step/step_parse.h" -#include "common/step/step_record.h" -#include "common/step/step_remove.h" +#include "common/step/step_register_app.h" +#include "common/step/step_remove_files.h" #include "common/step/step_revoke_security.h" -#include "common/step/step_security.h" +#include "common/step/step_register_security.h" #include "common/step/step_signal.h" -#include "common/step/step_signature.h" -#include "common/step/step_unregister.h" +#include "common/step/step_check_signature.h" +#include "common/step/step_unregister_app.h" #include "common/step/step_unzip.h" #include "tpk/step/step_parse.h" -#include "tpk/step/step_symbolic_link.h" +#include "tpk/step/step_create_symbolic_link.h" #include "utils/logging.h" #endif @@ -92,14 +92,14 @@ int Task::Install() { ci::AppInstaller ai(pi_, kPkgType); ai.AddStep(); - ai.AddStep(); + ai.AddStep(); ai.AddStep(); ai.AddStep(); ai.AddStep(); - ai.AddStep(); - ai.AddStep(); + ai.AddStep(); + ai.AddStep(); ai.AddStep(); - ai.AddStep(); + ai.AddStep(); return ai.Run(); } @@ -109,8 +109,8 @@ int Task::Uninstall() { ai.AddStep(); ai.AddStep(); - ai.AddStep(); - ai.AddStep(); + ai.AddStep(); + ai.AddStep(); ai.AddStep(); return ai.Run(); diff --git a/src/wgt/CMakeLists.txt b/src/wgt/CMakeLists.txt index 0a40355..b3d2014 100644 --- a/src/wgt/CMakeLists.txt +++ b/src/wgt/CMakeLists.txt @@ -1,7 +1,7 @@ # Target - sources SET(SRCS step/step_parse.cc - step/step_symbolic_link.cc + step/step_create_symbolic_link.cc wgt_backend.cc ) diff --git a/src/wgt/step/step_symbolic_link.cc b/src/wgt/step/step_create_symbolic_link.cc similarity index 91% rename from src/wgt/step/step_symbolic_link.cc rename to src/wgt/step/step_create_symbolic_link.cc index 58a50ed..0b82b09 100644 --- a/src/wgt/step/step_symbolic_link.cc +++ b/src/wgt/step/step_create_symbolic_link.cc @@ -1,6 +1,6 @@ /* 2014, Copyright © Eurogiciel Coporation, APACHE-2.0, see LICENSE file */ -#include "wgt/step/step_symbolic_link.h" +#include "wgt/step/step_create_symbolic_link.h" #include #include @@ -18,7 +18,7 @@ namespace symbolic_link { namespace fs = boost::filesystem; -common_installer::Step::Status StepSymbolicLink::process() { +common_installer::Step::Status StepCreateSymbolicLink::process() { assert(context_->manifest_data()); boost::system::error_code error; uiapplication_x* ui = context_->manifest_data()->uiapplication; @@ -64,11 +64,11 @@ common_installer::Step::Status StepSymbolicLink::process() { return Status::OK; } -common_installer::Step::Status StepSymbolicLink::clean() { +common_installer::Step::Status StepCreateSymbolicLink::clean() { return Status::OK; } -common_installer::Step::Status StepSymbolicLink::undo() { +common_installer::Step::Status StepCreateSymbolicLink::undo() { uiapplication_x* ui = context_->manifest_data()->uiapplication; serviceapplication_x* svc = context_->manifest_data()->serviceapplication; diff --git a/src/wgt/step/step_symbolic_link.h b/src/wgt/step/step_create_symbolic_link.h similarity index 70% rename from src/wgt/step/step_symbolic_link.h rename to src/wgt/step/step_create_symbolic_link.h index 1ced2fb..7cff643 100644 --- a/src/wgt/step/step_symbolic_link.h +++ b/src/wgt/step/step_create_symbolic_link.h @@ -1,7 +1,7 @@ /* 2014, Copyright © Samsung, license APACHE-2.0, see LICENSE file */ -#ifndef WGT_STEP_STEP_SYMBOLIC_LINK_H_ -#define WGT_STEP_STEP_SYMBOLIC_LINK_H_ +#ifndef WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ +#define WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ #include @@ -13,7 +13,7 @@ namespace wgt { namespace symbolic_link { -class StepSymbolicLink : public common_installer::Step { +class StepCreateSymbolicLink : public common_installer::Step { public: using Step::Step; @@ -27,4 +27,4 @@ class StepSymbolicLink : public common_installer::Step { } // namespace symbolic_link } // namespace wgt -#endif // WGT_STEP_STEP_SYMBOLIC_LINK_H_ +#endif // WGT_STEP_STEP_CREATE_SYMBOLIC_LINK_H_ diff --git a/src/wgt/wgt_backend.cc b/src/wgt/wgt_backend.cc index 70b82e5..804cbb0 100644 --- a/src/wgt/wgt_backend.cc +++ b/src/wgt/wgt_backend.cc @@ -16,16 +16,16 @@ #include "common/step/step_copy.h" #include "common/step/step_generate_xml.h" #include "common/step/step_parse.h" -#include "common/step/step_record.h" -#include "common/step/step_remove.h" +#include "common/step/step_register_app.h" +#include "common/step/step_remove_files.h" #include "common/step/step_revoke_security.h" -#include "common/step/step_security.h" +#include "common/step/step_register_security.h" #include "common/step/step_signal.h" -#include "common/step/step_signature.h" -#include "common/step/step_unregister.h" +#include "common/step/step_check_signature.h" +#include "common/step/step_unregister_app.h" #include "common/step/step_unzip.h" #include "wgt/step/step_parse.h" -#include "wgt/step/step_symbolic_link.h" +#include "wgt/step/step_create_symbolic_link.h" namespace ci = common_installer; @@ -46,21 +46,21 @@ int main(int argc, char** argv) { switch (pkgmgr_installer_get_request_type(pi)) { case PKGMGR_REQ_INSTALL: { installer.AddStep(); - installer.AddStep(); + installer.AddStep(); installer.AddStep(); installer.AddStep(); installer.AddStep(); - installer.AddStep(); - installer.AddStep(); + installer.AddStep(); + installer.AddStep(); installer.AddStep(); - installer.AddStep(); + installer.AddStep(); break; } case PKGMGR_REQ_UNINSTALL: { installer.AddStep(); installer.AddStep(); - installer.AddStep(); - installer.AddStep(); + installer.AddStep(); + installer.AddStep(); installer.AddStep(); break; }