modification for seperation of RO/RW location 02/60202/4
authorjongmyeongko <jongmyeong.ko@samsung.com>
Wed, 24 Feb 2016 06:30:22 +0000 (15:30 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Thu, 25 Feb 2016 04:14:30 +0000 (13:14 +0900)
Requires:
https://review.tizen.org/gerrit/#/c/60194/
https://review.tizen.org/gerrit/#/c/60200/

Change-Id: I4d30e3091772d12f70892610e3bbb7e5ff27a6d7
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/tpk/step/step_convert_xml.cc
src/tpk/step/step_parse_preload.cc
src/tpk/step/step_tpk_patch_icons.cc
src/unit_tests/smoke_test.cc

index 651519b..6d4fce7 100644 (file)
@@ -88,7 +88,9 @@ common_installer::Step::Status StepConvertXml::process() {
   if (!ConvertXml(doc))
     return Step::Status::MANIFEST_ERROR;
 
-  bf::path new_path = bf::path(getUserManifestPath(context_->uid.get()))
+  bf::path new_path =
+      bf::path(getUserManifestPath(context_->uid.get(),
+         context_->is_preload_request.get()))
       / bf::path(context_->pkgid.get());
   new_path += ".xml";
   if (!bf::exists(new_path.parent_path())) {
index d080b4c..ae6d5cc 100644 (file)
 #include "common/pkgmgr_interface.h"
 #include "common/utils/file_util.h"
 
-namespace {
-const char kPathManifestPrefix[] = "/usr/share/packages";
-}
-
 namespace common_installer {
 namespace tpk {
 
index fd5a540..7058b57 100644 (file)
@@ -21,12 +21,12 @@ namespace {
 
 // This function checks for alternative locations of icon file of tpk package
 bf::path LocateIcon(const bf::path& filename, const std::string& pkgid,
-                    const bf::path& root_path, uid_t uid) {
+                    const bf::path& root_path, uid_t uid, bool is_preload) {
   std::vector<bf::path> locations;
   // FIXME: icons for preloaded apps should also be moved to "shared/res"
-  bf::path system_location = bf::path(getIconPath(uid)) / filename;
+  bf::path system_location = bf::path(getIconPath(uid, is_preload)) / filename;
   bf::path small_system_location =
-      bf::path(getIconPath(uid)) / "default" / "small" / filename;
+      bf::path(getIconPath(uid, is_preload)) / "default" / "small" / filename;
   bf::path res_icons_location = root_path / pkgid / "res" / "icons" / filename;
 
   locations.push_back(system_location);
@@ -72,7 +72,8 @@ common_installer::Step::Status StepTpkPatchIcons::FixIconLocation(
   bf::path source = LocateIcon(icon_text.filename(),
                                context_->pkgid.get(),
                                context_->root_application_path.get(),
-                               context_->uid.get());
+                               context_->uid.get(),
+                               context_->is_preload_request.get());
   if (!source.empty()) {
     LOG(DEBUG) << "Fix location of icon: " << source << " to: " << icon_text;
     if (!common_installer::CopyFile(source, icon_text)) {
index 531a410..4fedfa1 100644 (file)
@@ -132,8 +132,8 @@ void ValidatePackageFS(const std::string& pkgid, const std::string& appid) {
   ASSERT_TRUE(bf::exists(cache_path));
 
   bf::path manifest_path =
-      bf::path(getUserManifestPath(getuid())) / (pkgid + ".xml");
-  bf::path icon_path = bf::path(getIconPath(getuid())) / (appid + ".png");
+      bf::path(getUserManifestPath(getuid(), false)) / (pkgid + ".xml");
+  bf::path icon_path = bf::path(getIconPath(getuid(), false)) / (appid + ".png");
   ASSERT_TRUE(bf::exists(manifest_path));
   ASSERT_TRUE(bf::exists(icon_path));
 
@@ -152,8 +152,8 @@ void PackageCheckCleanup(const std::string& pkgid, const std::string& appid) {
   ASSERT_FALSE(bf::exists(package_path));
 
   bf::path manifest_path =
-      bf::path(getUserManifestPath(getuid())) / (pkgid + ".xml");
-  bf::path icon_path = bf::path(getIconPath(getuid())) / (appid + ".png");
+      bf::path(getUserManifestPath(getuid(), false)) / (pkgid + ".xml");
+  bf::path icon_path = bf::path(getIconPath(getuid(), false)) / (appid + ".png");
   ASSERT_FALSE(bf::exists(manifest_path));
   ASSERT_FALSE(bf::exists(icon_path));