summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangyoon Jang <s89.jang@samsung.com>2016-12-23 11:40:28 +0900
committerSangyoon Jang <s89.jang@samsung.com>2016-12-22 21:17:10 -0800
commit0f1987e1221a9796bc0529fd0178aef43e2d6e7a (patch)
treee8ad53b1bbda978a78c9c68fda1610592feda33c
parent17ac9a6ce5e739c965e0ca324e3068524362f227 (diff)
downloadapp-installers-0f1987e1221a9796bc0529fd0178aef43e2d6e7a.tar.gz
app-installers-0f1987e1221a9796bc0529fd0178aef43e2d6e7a.tar.bz2
app-installers-0f1987e1221a9796bc0529fd0178aef43e2d6e7a.zip
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.cc24
-rw-r--r--src/common/pkgmgr_interface.h2
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