fix codes to manifest direct install works properly for preload apps 08/55108/3 accepted/tizen/mobile/20151224.063315 accepted/tizen/tv/20151224.063348 accepted/tizen/wearable/20151224.063429 submit/tizen/20151224.015514 submit/tizen_common/20151229.142028 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 22 Dec 2015 02:59:38 +0000 (11:59 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 24 Dec 2015 00:41:02 +0000 (09:41 +0900)
[app-installers][tpk-backend]

Change-Id: Ifc7137dc54e0c926595e1b84f8d143eebbeb6b92
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/pkgmgr_interface.cc
src/common/step/step_configure.cc

index ca03b3f..a72ab4a 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <memory>
 #include <string>
+#include <fstream>
 
 #include "common/app_query_interface.h"
 
@@ -82,6 +83,22 @@ int PkgMgrInterface::InitInternal(int argc, char** argv) {
           << xml_path;
       return EINVAL;
     }
+
+    // pkgid should be exists in preload app list
+    std::ifstream preload_list("/etc/package-manager/preload/preload_list.txt");
+    bool is_preload_app = false;
+    for (std::string str; std::getline(preload_list, str); ) {
+      if(str.compare(directory_path.filename().string()) == 0) {
+        is_preload_app = true;
+        break;
+      }
+    }
+    preload_list.close();
+
+    if (!is_preload_app) {
+      LOG(ERROR) << "Only preload app could be installed by manifest direct install";
+      return EINVAL;
+    }
   }
 
   is_app_installed_ = false;
index a5b95ef..ebbfda5 100644 (file)
@@ -74,6 +74,8 @@ Step::Status StepConfigure::process() {
       context_->pkgid.set(context_->xml_path.get().stem().string());
       context_->unpacked_dir_path.set(pkgmgr_->GetDirectoryPath());
       context_->pkg_path.set(pkgmgr_->GetDirectoryPath());
+      context_->privilege_level.set(common_installer::PrivilegeLevel::PUBLIC);
+      context_->pkg_type.set("rpm"); //temporary fix as rpm
       break;
     default:
       // TODO(p.sikorski): should return unsupported, and display error