if (!ValidateSettingsForLevel(context_->privilege_level.get(),
static_cast<WgtBackendData*>(
context_->backend_data.get())->settings.get())) {
- return Status::ERROR;
+ return Status::PRIVILEGE_ERROR;
}
LOG(INFO) << "Settings privilege level checked";
return Status::OK;
}
if (context_->pkgid.get().empty()) {
LOG(ERROR) << "pkgid attribute is empty";
- return Step::Status::INVALID_VALUE; }
+ return Step::Status::PACKAGE_NOT_FOUND; }
if (!context_->manifest_data.get()->application) {
LOG(ERROR) << "No application in package";
if (!common_installer::CreateDir(xml_path.parent_path())) {
LOG(ERROR) <<
"Directory for manifest xml is missing and cannot be created";
- return Status::ERROR;
+ return Status::MANIFEST_ERROR;
}
}
writer = xmlNewTextWriterFilename(context_->xml_path.get().c_str(), 0);
if (!writer) {
LOG(ERROR) << "Failed to create new file";
- return Step::Status::ERROR;
+ return Step::Status::MANIFEST_ERROR;
}
xmlTextWriterStartDocument(writer, nullptr, nullptr, nullptr);
if (pkgmgr_parser_check_manifest_validation(
context_->xml_path.get().c_str()) != 0) {
LOG(ERROR) << "Manifest is not valid";
- return Step::Status::ERROR;
+ return Step::Status::MANIFEST_ERROR;
}
LOG(DEBUG) << "Successfully create manifest xml "
common_installer::Step::Status StepParse::process() {
if (!LocateConfigFile()) {
LOG(ERROR) << "No config.xml";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::MANIFEST_NOT_FOUND;
}
parser_.reset(new wgt::parse::WidgetConfigParser());
if (!parser_->ParseManifest(config_)) {
LOG(ERROR) << "[Parse] Parse failed. " << parser_->GetErrorMessage();
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PARSE_ERROR;
}
if (check_start_file_) {
if (!parser_->HasValidStartFile()) {
LOG(ERROR) << parser_->GetErrorMessage();
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PARSE_ERROR;
}
if (!parser_->HasValidServicesStartFiles()) {
LOG(ERROR) << parser_->GetErrorMessage();
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PARSE_ERROR;
}
}
if (!FillManifestX(manifest)) {
LOG(ERROR) << "[Parse] Storing manifest_x failed. "
<< parser_->GetErrorMessage();
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PARSE_ERROR;
}
// Copy data from ManifestData to InstallerContext
common_installer::Step::Status StepParseRecovery::precheck() {
if (context_->root_application_path.get().empty()) {
LOG(ERROR) << "Root path of packages in not set";
- return Status::ERROR;
+ return Status::INVALID_VALUE;
}
if (context_->pkgid.get().empty()) {
LOG(WARNING) << "Pkgid is not set. Parsing skipped";
common_installer::Step::Status StepRDSModify::precheck() {
if (context_->unpacked_dir_path.get().empty()) {
LOG(ERROR) << "unpacked dir path is not set";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::INVALID_VALUE;
}
if (!bf::exists(context_->unpacked_dir_path.get())) {
LOG(ERROR) << "unpacked_dir_path ("
<< context_->unpacked_dir_path.get()
<< ") path does not exist";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::INVALID_VALUE;
}
if (context_->pkgid.get().empty()) {
LOG(ERROR) << "pkgid is not set";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PACKAGE_NOT_FOUND;
}
if (!context_->manifest_data.get()) {
LOG(ERROR) << "no manifest info available";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::INVALID_VALUE;
}
// TODO(w.kosowicz): check if config of installed app was encrypted
backend_data_ = static_cast<WgtBackendData*>(context_->backend_data.get());
bf::path rdsPath(context_->unpacked_dir_path.get() / ".rds_delta");
if (!bf::exists(rdsPath)) {
LOG(ERROR) << "no rds_delta file";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::INVALID_VALUE;
}
rds_file_path_ = rdsPath;
return common_installer::Step::Status::OK;
wgt::rds_parser::RDSParser parser(rds_file_path_.native());
if (!parser.Parse()) {
LOG(ERROR) << "parsing of rds delta failed";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PARSE_ERROR;
}
WgtBackendData* backend_data =
static_cast<WgtBackendData*>(context_->backend_data.get());
if (!backend_data) {
LOG(ERROR) << "no wgt backend data available";
- return common_installer::Step::Status::ERROR;
+ return common_installer::Step::Status::PARSE_ERROR;
}
backend_data->files_to_modify.set(parser.files_to_modify());
backend_data->files_to_add.set(parser.files_to_add());
if (status != Status::OK)
return status;
if (!CacheDir())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
int version = context_->manifest_data.get()->api_version[0] - '0';
if (version < 3) {
common_installer::Step::Status StepWgtCreateStorageDirectories::process() {
if (!PrivateDir())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
char version = context_->manifest_data.get()->api_version[0];
if ((version-'0') < 3) {
LOG(DEBUG) << "Shared directory preparation for tizen 2.x";
if (!ShareDir())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
} else {
LOG(DEBUG) << "Shared directory preparation for tizen 3.x";
if (!ShareDirFor3x())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
}
if (!SubShareDir())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
if (!CreatePrivateTmpDir())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
if (!CacheDir())
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
return Status::OK;
}
temp_path)) {
LOG(ERROR) << "Failed to move: " << context_->unpacked_dir_path.get()
<< " to: " << temp_path;
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
}
bs::error_code error;
bf::create_directories(resource_path.parent_path(), error);
if (error) {
LOG(ERROR) << "Failed to create proper directory structure in widget";
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
}
if (!common_installer::MoveDir(temp_path, resource_path)) {
LOG(ERROR) << "Failed to move: " << temp_path << " to: " << resource_path;
- return Status::ERROR;
+ return Status::APP_DIR_ERROR;
}
LOG(INFO) << "Widget content moved to res/wgt subdirectory";