summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-06-05 08:19:09 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-06-05 15:12:10 +0200
commitb1c754300a774fbd01c2d88da20626e893a93095 (patch)
tree78bbf2a5f6255aadd56dbb2ba860cb46744875ba
parent13820d2b168e96efa83aa04aab3e5a06c97fe78b (diff)
downloadaur-b1c754300a774fbd01c2d88da20626e893a93095.tar.gz
aur-b1c754300a774fbd01c2d88da20626e893a93095.tar.xz
Fix links to AUR packages in optional dependencies
Extend the SQL query that tries to find a package's dependencies so that optional dependencies with a description are correctly resolved. Fixes FS#40700. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--web/lib/pkgfuncs.inc.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 3bbf1a1e..fed7c03c 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -170,6 +170,7 @@ function pkg_dependencies($pkgid) {
$dbh = DB::connect();
$q = "SELECT pd.DepName, dt.Name, pd.DepCondition, p.ID FROM PackageDepends pd ";
$q.= "LEFT JOIN Packages p ON pd.DepName = p.Name ";
+ $q.= "OR SUBSTRING(pd.DepName FROM 1 FOR POSITION(': ' IN pd.DepName) - 1) = p.Name ";
$q.= "LEFT JOIN DependencyTypes dt ON dt.ID = pd.DepTypeID ";
$q.= "WHERE pd.PackageID = ". $pkgid . " ";
$q.= "ORDER BY pd.DepName";