From: jongmyeongko Date: Wed, 3 Feb 2016 11:10:21 +0000 (+0900) Subject: add symlink for ui-gadget application X-Git-Tag: accepted/tizen/mobile/20160205.064207~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F58789%2F6;p=platform%2Fcore%2Fappfw%2Ftpk-backend.git add symlink for ui-gadget application Change-Id: I85486ac70ac4d2ed78077b76b52035349228000a Signed-off-by: jongmyeongko --- diff --git a/src/tpk/step/step_create_symbolic_link.cc b/src/tpk/step/step_create_symbolic_link.cc index f4e3353..649df19 100644 --- a/src/tpk/step/step_create_symbolic_link.cc +++ b/src/tpk/step/step_create_symbolic_link.cc @@ -18,11 +18,11 @@ namespace tpk { namespace filesystem { namespace bf = boost::filesystem; +namespace ci = common_installer; + using common_installer::InstallerContext; typedef common_installer::Step::Status Status; -namespace { - bool CreateSymLink(application_x* app, InstallerContext* context) { boost::system::error_code boost_error; bf::path bindir = context->pkg_path.get() / @@ -33,15 +33,38 @@ bool CreateSymLink(application_x* app, InstallerContext* context) { return false; } - // Exec path - // Make a symlink with the name of appid, pointing exec file - bf::path symlink_path = bindir / bf::path(app->appid); - LOG(DEBUG) << "Creating symlink " << symlink_path << " pointing " << - app->exec; - bf::create_symlink(bf::path(app->exec), symlink_path, boost_error); - if (boost_error) { - LOG(ERROR) << "Symlink creation failure: " << symlink_path; - return false; + if (strcmp(app->ui_gadget, "true") == 0) { + // Ug-client path + // Make a symlink with the name of appid, pointing /usr/bin/ug-client + bf::path app_exec_path(app->exec); + if (!bf::exists(app_exec_path)) { + bf::path ug_client_path(tzplatform_mkpath(TZ_SYS_BIN, "ug-client")); + LOG(INFO) << "Createing symlink " << app_exec_path << " pointing " << + ug_client_path; + bf::create_symlink(ug_client_path, app_exec_path, boost_error); + if (boost_error) { + LOG(ERROR) << "Symlink creation failure: " << app_exec_path; + return false; + } + } + } else { + if (context->request_type.get() == ci::RequestType::ManifestDirectInstall || + context->request_type.get() == ci::RequestType::ManifestDirectUpdate) { + return true; + } + + // Exec path + // Make a symlink with the name of appid, pointing exec file + bf::path symlink_path = bindir / bf::path(app->appid); + if (!bf::exists(symlink_path)) { + LOG(DEBUG) << "Creating symlink " << symlink_path << " pointing " << + app->exec; + bf::create_symlink(bf::path(app->exec), symlink_path, boost_error); + if (boost_error) { + LOG(ERROR) << "Symlink creation failure: " << symlink_path; + return false; + } + } } return true; @@ -62,8 +85,6 @@ bool SetExecPermission(application_x* app) { return true; } -} // namespace - Status StepCreateSymbolicLink::precheck() { manifest_x *m = context_->manifest_data.get(); if (!m) { diff --git a/src/tpk/step/step_manifest_adjustment.cc b/src/tpk/step/step_manifest_adjustment.cc index 7777e68..ded3b93 100644 --- a/src/tpk/step/step_manifest_adjustment.cc +++ b/src/tpk/step/step_manifest_adjustment.cc @@ -10,6 +10,7 @@ #include #include #include +#include namespace bs = boost::system; namespace bf = boost::filesystem; diff --git a/src/tpk/step/step_parse_preload.h b/src/tpk/step/step_parse_preload.h index 8bbaebd..3eb7606 100644 --- a/src/tpk/step/step_parse_preload.h +++ b/src/tpk/step/step_parse_preload.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_PARSE_PRELOAD_H_ -#define COMMON_STEP_STEP_PARSE_PRELOAD_H_ +#ifndef TPK_STEP_STEP_PARSE_PRELOAD_H_ +#define TPK_STEP_STEP_PARSE_PRELOAD_H_ #include @@ -28,4 +28,4 @@ class StepParsePreload : public common_installer::Step { } // namespace tpk } // namespace common_installer -#endif // COMMON_STEP_STEP_PARSE_PRELOAD_H_ +#endif // TPK_STEP_STEP_PARSE_PRELOAD_H_ diff --git a/src/tpk/tpk_installer.cc b/src/tpk/tpk_installer.cc index aaac56c..bff2a59 100644 --- a/src/tpk/tpk_installer.cc +++ b/src/tpk/tpk_installer.cc @@ -225,6 +225,7 @@ void TpkInstaller::ManifestDirectInstallSteps() { AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep(); @@ -240,6 +241,7 @@ void TpkInstaller::ManifestDirectUpdateSteps() { AddStep(); AddStep(); AddStep(); + AddStep(); AddStep(); AddStep(); AddStep();