diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2015-10-24 18:27:32 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-10-24 18:33:00 +0200 |
commit | b30135111a25efeb7758b12a60a1f1d1d4d1d5ed (patch) | |
tree | a1c5668966973e52b1cdec2edb64ac6dc8985453 /web | |
parent | 5d119c02ea81df9f4f688e2fb2ecf0f15e21ad33 (diff) | |
download | aur-b30135111a25efeb7758b12a60a1f1d1d4d1d5ed.tar.gz aur-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')
-rw-r--r-- | web/lib/pkgfuncs.inc.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 34ec2c51..dab4315a 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); |