}
InstallerContext::InstallerContext()
- : manifest_data(static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)))),
+ : manifest_data(nullptr),
old_manifest_data(nullptr),
uid(getuid()),
backend_data(nullptr),
return common_installer::Step::Status::ERROR;
}
- const manifest_x* manifest = context_->manifest_data.get();
+ manifest_x* manifest =
+ static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
if (!FillManifestX(const_cast<manifest_x*>(manifest))) {
LOG(ERROR) << "[Parse] Storing manifest_x failed. "
<< parser_->GetErrorMessage();
LOG(DEBUG) << " ]-";
LOG(DEBUG) << "]-";
+ context_->manifest_data.set(manifest);
return common_installer::Step::Status::OK;
}
}
}
- manifest_x* manifest = context_->manifest_data.get();
+ manifest_x* manifest =
+ static_cast<manifest_x*>(calloc(1, sizeof(manifest_x)));
if (!FillManifestX(manifest)) {
LOG(ERROR) << "[Parse] Storing manifest_x failed. "
<< parser_->GetErrorMessage();
const std::string& package_version = wgt_info->version();
const std::string& required_api_version = info->required_version();
- context_->manifest_data.get()->api_version =
- strdup(required_api_version.c_str());
+ manifest->api_version = strdup(required_api_version.c_str());
context_->pkgid.set(manifest->package);
// write pkgid for recovery file
LOG(DEBUG) << " ]-";
LOG(DEBUG) << "]-";
+ context_->manifest_data.set(manifest);
return common_installer::Step::Status::OK;
}