summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorcanyonknight <canyonknight@gmail.com>2012-11-14 23:05:53 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2012-11-15 20:03:33 +0100
commit16a20693be07600e25dcf5edeb94e53699f63787 (patch)
tree7e29fc60b83de61283aa6df9e6b863b9cfc6a109 /web/lib/pkgfuncs.inc.php
parentdd61e561a0a222bc0952e428081f6811236aeba8 (diff)
downloadaur-16a20693be07600e25dcf5edeb94e53699f63787.tar.gz
aur-16a20693be07600e25dcf5edeb94e53699f63787.tar.xz
pkgfuncs.inc.php: Rework query to avoid "Required by" duplicates
Packages with multiple DepConditions are returned multiple times in the "Required by" column. Limit SQL results to distinct packages. Fixes FS#32478 Signed-off-by: canyonknight <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 8f84cdf5..cfdd9a79 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -169,7 +169,7 @@ function package_required($name="", $dbh=NULL) {
if(!$dbh) {
$dbh = db_connect();
}
- $q = "SELECT p.Name, PackageID FROM PackageDepends pd ";
+ $q = "SELECT DISTINCT p.Name, PackageID FROM PackageDepends pd ";
$q.= "JOIN Packages p ON pd.PackageID = p.ID ";
$q.= "WHERE DepName = " . $dbh->quote($name) . " ";
$q.= "ORDER BY p.Name";