Commit b3013511 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

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's avatarLukas Fleischer <lfleischer@archlinux.org>
parent 5d119c02
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment