summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-10-24 18:27:32 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-10-24 18:33:00 +0200
commitb30135111a25efeb7758b12a60a1f1d1d4d1d5ed (patch)
treea1c5668966973e52b1cdec2edb64ac6dc8985453 /web/lib/pkgfuncs.inc.php
parent5d119c02ea81df9f4f688e2fb2ecf0f15e21ad33 (diff)
downloadaurweb-b30135111a25efeb7758b12a60a1f1d1d4d1d5ed.tar.xz
Include trivial AUR providers in pkg_providers()
When obtaining provisions using pkg_providers(), we already include virtual providers from the official repositories, virtual providers from the AUR and trivial providers (i.e. packages having the given name) from the official repositories. Include trivial providers from the AUR as well. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 34ec2c5..dab4315 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -164,10 +164,11 @@ function pkg_groups($pkgid) {
function pkg_providers($name) {
$dbh = DB::connect();
$q = "SELECT p.ID, p.Name FROM Packages p ";
- $q.= "INNER JOIN PackageRelations pr ON pr.PackageID = p.ID ";
- $q.= "INNER JOIN RelationTypes rt ON rt.ID = pr.RelTypeID ";
- $q.= "WHERE rt.Name = 'provides' ";
- $q.= "AND pr.RelName = " . $dbh->quote($name);
+ $q.= "LEFT JOIN PackageRelations pr ON pr.PackageID = p.ID ";
+ $q.= "LEFT JOIN RelationTypes rt ON rt.ID = pr.RelTypeID ";
+ $q.= "WHERE p.Name = " . $dbh->quote($name) . " ";
+ $q.= "OR (rt.Name = 'provides' ";
+ $q.= "AND pr.RelName = " . $dbh->quote($name) . ")";
$q.= "UNION ";
$q.= "SELECT 0, Name FROM OfficialProviders ";
$q.= "WHERE Provides = " . $dbh->quote($name);