From c8c56279efc109ac02465eb60c921fcc109a2ed4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 3 Jun 2016 00:17:27 +0100 Subject: Only parse and insert non-null deps --- gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp index ccb498a..c8d52a3 100644 --- a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp @@ -177,10 +177,14 @@ namespace Gentoo { // Dependencies ebuildIds.insert(ebuildId); depInsert->bindParamI(1, ebuildId); - depInsert->bindParamB(5, false); - insertDeps(Portage::Utils::Depend::parse(ecp.get("DEPEND").value_or(""))); - depInsert->bindParamB(5, true); - insertDeps(Portage::Utils::Depend::parse(ecp.get("RDEPEND").value_or(""))); + if (auto depend = ecp.getRange("DEPEND")) { + depInsert->bindParamB(5, false); + insertDeps(Portage::Utils::Depend::parse(depend->first, depend->second)); + } + if (auto rdepend = ecp.getRange("RDEPEND")) { + depInsert->bindParamB(5, true); + insertDeps(Portage::Utils::Depend::parse(rdepend->first, rdepend->second)); + } if (newest) { // HOMEPAGE U::EntityWhereFilter pwf("packageId", packageId); -- cgit v1.2.3