summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-06-03 00:17:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-06-03 00:17:27 +0100
commitc8c56279efc109ac02465eb60c921fcc109a2ed4 (patch)
treea96d703ddd1edba0ec369b3be4c0bd1692e0af04
parentSupport character range input to dependency scanner (diff)
downloadgentoobrowse-api-c8c56279efc109ac02465eb60c921fcc109a2ed4.tar.bz2
gentoobrowse-api-c8c56279efc109ac02465eb60c921fcc109a2ed4.tar.xz
gentoobrowse-api-c8c56279efc109ac02465eb60c921fcc109a2ed4.zip
Only parse and insert non-null deps
-rw-r--r--gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp12
1 files 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);