#include <tpk_manifest_handlers/tpk_config_parser.h>
#include <tpk_manifest_handlers/application_manifest_constants.h>
#include <tpk_manifest_handlers/author_handler.h>
+#include <tpk_manifest_handlers/dependencies_handler.h>
#include <tpk_manifest_handlers/description_handler.h>
#include <tpk_manifest_handlers/package_handler.h>
#include <tpk_manifest_handlers/privileges_handler.h>
return true;
}
+bool GetDependencyInfo(const tpk::parse::TPKConfigParser& parser,
+ package_manager_pkg_detail_info_t* info) {
+ auto dependencies_info =
+ std::static_pointer_cast<const tpk::parse::DependenciesInfo>(
+ parser.GetManifestData(tpk::application_keys::kDependenciesKey));
+ if (!dependencies_info)
+ return true;
+
+ for (const auto& dependency : dependencies_info->dependencies()) {
+ pkg_dependency_info_t* dep =
+ static_cast<pkg_dependency_info_t*>
+ (calloc(1, sizeof(pkg_dependency_info_t)));
+ if (!dep) {
+ LOG(ERROR) << "Out of memory";
+ return false;
+ }
+ snprintf(dep->pkgid, sizeof(dep->pkgid), "%s", dependency.pkgid().c_str());
+ snprintf(dep->type, sizeof(dep->type), "%s", dependency.type().c_str());
+ if (!dependency.type().empty())
+ snprintf(dep->required_version,
+ sizeof(dep->required_version), "%s",
+ dependency.required_version().c_str());
+ info->dependency_list = g_list_append(info->dependency_list, dep);
+ }
+ return true;
+}
+
template <typename T>
bool GetAppLabel(const tpk::parse::TPKConfigParser& parser,
const std::string& key, const char* locale,
LOG(WARNING) << "Failed to get author info";
if (!GetPrivilegesInfo(parser, info))
LOG(WARNING) << "Failed to get privilege info";
+ if (!GetDependencyInfo(parser, info))
+ LOG(WARNING) << "Failed to get dependency info";
char* locale = vconf_get_str(kVconfLanguageKey);
if (!locale)