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
if (perm_info)
permissions = perm_info->GetAPIPermissions();
- std::unique_ptr<WgtBackendData> backend_data(new WgtBackendData());
+ WgtBackendData* backend_data =
+ static_cast<WgtBackendData*>(context_->backend_data.get());
std::shared_ptr<const SettingInfo> settings_info =
std::static_pointer_cast<const SettingInfo>(
if (settings_info)
backend_data->settings.set(*settings_info);
- context_->backend_data.set(backend_data.release());
-
LOG(DEBUG) << " Read data -[ ";
LOG(DEBUG) << "App id: " << info->id();
LOG(DEBUG) << " package = " << info->package();
LOG(DEBUG) << " ]-";
LOG(DEBUG) << "]-";
+ // TODO(t.iwanek): In delta mode this step is running two times
+ if (context_->manifest_data.get())
+ pkgmgr_parser_free_manifest_xml(context_->manifest_data.get());
+
context_->manifest_data.set(manifest);
return common_installer::Step::Status::OK;
}
bool StepParse::Check(const boost::filesystem::path& widget_path) {
- boost::filesystem::path config = widget_path;
- config /= "config.xml";
+ boost::filesystem::path config = widget_path / "config.xml";
LOG(DEBUG) << "config.xml path: " << config;