[app-installers][tpk-backend]
Change-Id: Ifc7137dc54e0c926595e1b84f8d143eebbeb6b92
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
#include <memory>
#include <string>
+#include <fstream>
#include "common/app_query_interface.h"
<< 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;
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