From b30135111a25efeb7758b12a60a1f1d1d4d1d5ed Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 24 Oct 2015 18:27:32 +0200 Subject: 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 --- web/lib/pkgfuncs.inc.php | 9 +++++---- 1 file 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); -- cgit v1.2.3-70-g09d2