diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-06-03 00:17:27 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-06-03 00:17:27 +0100 |
commit | c58d637ab2a2828b6bdfe82d9f6e125836c3968a (patch) | |
tree | a96d703ddd1edba0ec369b3be4c0bd1692e0af04 | |
parent | Support character range input to dependency scanner (diff) | |
download | gentoobrowse-api-c58d637ab2a2828b6bdfe82d9f6e125836c3968a.tar.bz2 gentoobrowse-api-c58d637ab2a2828b6bdfe82d9f6e125836c3968a.tar.xz gentoobrowse-api-c58d637ab2a2828b6bdfe82d9f6e125836c3968a.zip |
Only parse and insert non-null deps
-rw-r--r-- | gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp | 12 |
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); |