[aur-dev] [PATCH] 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> --- 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); -- 2.6.2
participants (1)
-
Lukas Fleischer