From 830ad05056cbf27ca88baaff538daf601deb18d8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 4 Oct 2016 00:26:52 +0100 Subject: Filter out partial blocks and set blocks flag only on full ones in all kinds dependency --- gentoobrowse-api/service/sql/portage/getPackageDependencies.sql | 3 ++- .../service/sql/portage/getPackageRuntimeDependencies.sql | 4 ++-- gentoobrowse-api/service/sql/portage/getPackagesDepending.sql | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gentoobrowse-api/service/sql/portage/getPackageDependencies.sql b/gentoobrowse-api/service/sql/portage/getPackageDependencies.sql index 5a6b6c9..4e94348 100644 --- a/gentoobrowse-api/service/sql/portage/getPackageDependencies.sql +++ b/gentoobrowse-api/service/sql/portage/getPackageDependencies.sql @@ -1,6 +1,7 @@ -SELECT p.packageid, p.categoryid, p.name, p.description, p.summary, p.firstseen, p.maintainer, p.maintainername, p.herd, array_agg(e.ebuildid order by e.ebuildid) ebuildids, position('!' in d.op) > 0 block +SELECT p.packageid, p.categoryid, p.name, p.description, p.summary, p.firstseen, p.maintainer, p.maintainername, p.herd, array_agg(e.ebuildid order by e.ebuildid) ebuildids, '!' = d.op block FROM gentoobrowse.packages p, gentoobrowse.ebuilds e, gentoobrowse.ebuild_deps d WHERE e.packageid = ? AND e.ebuildid = d.ebuildid AND p.packageid = d.packageid +AND d.op NOT LIKE '!_%' GROUP BY p.packageid, block diff --git a/gentoobrowse-api/service/sql/portage/getPackageRuntimeDependencies.sql b/gentoobrowse-api/service/sql/portage/getPackageRuntimeDependencies.sql index e74d0d0..79ace98 100644 --- a/gentoobrowse-api/service/sql/portage/getPackageRuntimeDependencies.sql +++ b/gentoobrowse-api/service/sql/portage/getPackageRuntimeDependencies.sql @@ -1,7 +1,7 @@ -SELECT p.packageid, p.categoryid, p.name, p.description, p.summary, p.firstseen, p.maintainer, p.maintainername, p.herd, array_agg(e.ebuildid order by e.ebuildid) ebuildids, position('!' in d.op) > 0 block +SELECT p.packageid, p.categoryid, p.name, p.description, p.summary, p.firstseen, p.maintainer, p.maintainername, p.herd, array_agg(e.ebuildid order by e.ebuildid) ebuildids, '!' = d.op block FROM gentoobrowse.packages p, gentoobrowse.ebuilds e, gentoobrowse.ebuild_rdeps d WHERE e.packageid = ? AND e.ebuildid = d.ebuildid AND p.packageid = d.packageid +AND d.op NOT LIKE '!_%' GROUP BY p.packageid, block - diff --git a/gentoobrowse-api/service/sql/portage/getPackagesDepending.sql b/gentoobrowse-api/service/sql/portage/getPackagesDepending.sql index c86d1f9..626a857 100644 --- a/gentoobrowse-api/service/sql/portage/getPackagesDepending.sql +++ b/gentoobrowse-api/service/sql/portage/getPackagesDepending.sql @@ -1,4 +1,4 @@ -SELECT p.packageid, p.categoryid, p.name, p.description, p.summary, p.firstseen, p.maintainer, p.maintainername, p.herd, array_agg(e.ebuildid order by e.ebuildid) ebuildids, position('!' in d.op) > 0 block +SELECT p.packageid, p.categoryid, p.name, p.description, p.summary, p.firstseen, p.maintainer, p.maintainername, p.herd, array_agg(e.ebuildid order by e.ebuildid) ebuildids, '!' = d.op block FROM gentoobrowse.packages p, gentoobrowse.ebuilds e, ( SELECT d.ebuildid, d.packageid, d.op FROM gentoobrowse.ebuild_rdeps d @@ -8,4 +8,5 @@ FROM gentoobrowse.packages p, gentoobrowse.ebuilds e, ( WHERE d.packageid = ? AND e.ebuildid = d.ebuildid AND p.packageid = e.packageid +AND d.op NOT LIKE '!_%' GROUP BY p.packageid, block -- cgit v1.2.3