summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-10-04 00:26:52 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-10-04 00:26:52 +0100
commit830ad05056cbf27ca88baaff538daf601deb18d8 (patch)
tree2d092cddf356a101bd348b55ca1ebf783e3795af
parentAdd slicer collection element metadata (diff)
downloadgentoobrowse-api-830ad05056cbf27ca88baaff538daf601deb18d8.tar.bz2
gentoobrowse-api-830ad05056cbf27ca88baaff538daf601deb18d8.tar.xz
gentoobrowse-api-830ad05056cbf27ca88baaff538daf601deb18d8.zip
Filter out partial blocks and set blocks flag only on full ones in all kinds dependency
-rw-r--r--gentoobrowse-api/service/sql/portage/getPackageDependencies.sql3
-rw-r--r--gentoobrowse-api/service/sql/portage/getPackageRuntimeDependencies.sql4
-rw-r--r--gentoobrowse-api/service/sql/portage/getPackagesDepending.sql3
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