From 7e426154c9d96b439e38bce061dd667bde2e4d26 Mon Sep 17 00:00:00 2001 From: Junghyun Yeon Date: Wed, 2 Dec 2020 13:02:06 +0900 Subject: [PATCH] Remove unused logic According to the previous Tizen concept, same package could be installed both global and user pkg. And when user tries to uninstall user pkg, symlinks for global pkg should be created to change pkg as global pkg. This concept is no longer exists so related logic should be removed. Change-Id: I1fdf9b39043940ef3a2ede05695100acaac22105 Signed-off-by: Junghyun Yeon --- src/common/installer/app_installer.cc | 1 - .../filesystem/step_create_globalapp_symlinks.cc | 30 ++++++---------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/common/installer/app_installer.cc b/src/common/installer/app_installer.cc index 9cd1e4e..8c1f6ef 100644 --- a/src/common/installer/app_installer.cc +++ b/src/common/installer/app_installer.cc @@ -418,7 +418,6 @@ void AppInstaller::UninstallSteps() { AddStep(); AddStep(); AddStep(); - AddStep(); } void AppInstaller::ReinstallSteps() { diff --git a/src/common/step/filesystem/step_create_globalapp_symlinks.cc b/src/common/step/filesystem/step_create_globalapp_symlinks.cc index 9672b45..3a09334 100644 --- a/src/common/step/filesystem/step_create_globalapp_symlinks.cc +++ b/src/common/step/filesystem/step_create_globalapp_symlinks.cc @@ -22,30 +22,16 @@ namespace common_installer { namespace filesystem { common_installer::Step::Status StepCreateGlobalAppSymlinks::process() { - if (context_->is_readonly_package.get()) + if (context_->is_readonly_package.get() || + context_->request_mode.get() == RequestMode::USER) return Step::Status::OK; - std::string package_id = context_->pkgid.get(); - if (context_->request_type.get() == RequestType::Uninstall) { - PkgQueryInterface pkg_query(context_->pkgid.get(), kGlobalUserUid); - if ((context_->request_mode.get() == RequestMode::USER) && - pkg_query.IsPackageInstalled()) { - LOG(INFO) << "Creating globalapp symlinks for current user, package: " - << package_id; - if (!CreateGlobalAppSymlinksForUser(package_id, context_->uid.get())) { - LOG(ERROR) << "Failed to create globalapp symlinks"; - return Status::GLOBALSYMLINK_ERROR; - } - } - } else { - if (context_->request_mode.get() == RequestMode::GLOBAL) { - LOG(INFO) << "Creating globalapp symlinks for all user, package: " - << package_id; - if (!CreateGlobalAppSymlinksForAllUsers(package_id)) { - LOG(ERROR) << "Failed to create globalapp symlinks"; - return Status::GLOBALSYMLINK_ERROR; - } - } + std::string package_id = context_->pkgid.get(); + LOG(INFO) << "Creating globalapp symlinks for all user, package: " + << package_id; + if (!CreateGlobalAppSymlinksForAllUsers(package_id)) { + LOG(ERROR) << "Failed to create globalapp symlinks"; + return Status::GLOBALSYMLINK_ERROR; } return Status::OK; -- 2.7.4