diff options
author | Sangyoon Jang <s89.jang@samsung.com> | 2016-12-23 11:40:28 +0900 |
---|---|---|
committer | Sangyoon Jang <s89.jang@samsung.com> | 2016-12-22 21:17:10 -0800 |
commit | 0f1987e1221a9796bc0529fd0178aef43e2d6e7a (patch) | |
tree | e8ad53b1bbda978a78c9c68fda1610592feda33c | |
parent | 17ac9a6ce5e739c965e0ca324e3068524362f227 (diff) | |
download | app-installers-0f1987e1221a9796bc0529fd0178aef43e2d6e7a.tar.gz app-installers-0f1987e1221a9796bc0529fd0178aef43e2d6e7a.tar.bz2 app-installers-0f1987e1221a9796bc0529fd0178aef43e2d6e7a.zip |
Revert "Support legacy content directory path"submit/tizen_3.0/20161223.043050accepted/tizen/3.0/wearable/20161226.030230accepted/tizen/3.0/tv/20161226.030204accepted/tizen/3.0/mobile/20161226.030123accepted/tizen/3.0/ivi/20161226.030257accepted/tizen/3.0/common/20161228.071533
This reverts commit 10d8245726f7cc1125878a3af35cb2ddf92df867.
Adjusting legacy content path will be done by pkgmgr-server.
Submit with:
- https://review.tizen.org/gerrit/106773
Change-Id: I9eb30805c8ba9837cbe33687b3b0dfb349e552bd
-rw-r--r-- | src/common/pkgmgr_interface.cc | 24 | ||||
-rw-r--r-- | src/common/pkgmgr_interface.h | 2 |
2 files changed, 4 insertions, 22 deletions
diff --git a/src/common/pkgmgr_interface.cc b/src/common/pkgmgr_interface.cc index 5464bae2..4d787ac5 100644 --- a/src/common/pkgmgr_interface.cc +++ b/src/common/pkgmgr_interface.cc @@ -9,7 +9,6 @@ #include <tzplatform_config.h> -#include <cstring> #include <memory> #include <string> #include <fstream> @@ -24,7 +23,6 @@ namespace bf = boost::filesystem; namespace { const char kDeltaFileExtension[] = ".delta"; -const char kLegacyContentPath[] = "/opt/usr/media"; const uid_t kGlobalUserUid = tzplatform_getuid(TZ_SYS_GLOBALAPP_USER); } @@ -108,7 +106,7 @@ RequestType PkgMgrInterface::GetRequestType() const { switch (pkgmgr_installer_get_request_type(pi_)) { case PKGMGR_REQ_INSTALL : { auto request_info = GetRequestInfo(); - if (request_info.empty()) + if (!request_info) return RequestType::Unknown; std::string extension = bf::path(request_info).extension().string(); if (!is_app_installed_.get()) { @@ -179,24 +177,8 @@ uid_t PkgMgrInterface::GetUid() const { return pkgmgr_installer_get_uid(pi_); } -std::string PkgMgrInterface::GetRequestInfo() const { - std::string info; - const char* raw_info = pkgmgr_installer_get_request_info(pi_); - if (raw_info == nullptr) - return {}; - // to support legacy content directory path, - // if the requested path starts with "/opt/usr/media", return modified path. - // note that "/opt/usr/media" is a mount point for TZ_USER_CONTENT. - if (!strncmp(raw_info, kLegacyContentPath, strlen(kLegacyContentPath))) { - tzplatform_set_user(GetUid()); - const char* content_path = tzplatform_getenv(TZ_USER_CONTENT); - tzplatform_reset_user(); - info = std::string(content_path) + - std::string(raw_info + strlen(kLegacyContentPath)); - } else { - info = std::string(raw_info); - } - return info; +const char* PkgMgrInterface::GetRequestInfo() const { + return pkgmgr_installer_get_request_info(pi_); } boost::filesystem::path PkgMgrInterface::GetTepPath() const { diff --git a/src/common/pkgmgr_interface.h b/src/common/pkgmgr_interface.h index 86beb196..f903a8c8 100644 --- a/src/common/pkgmgr_interface.h +++ b/src/common/pkgmgr_interface.h @@ -82,7 +82,7 @@ class PkgMgrInterface { * * \return request info retrieved from pkgmgr_installer */ - std::string GetRequestInfo() const; + const char *GetRequestInfo() const; /** * Creates PkgMgrInterface |