Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-14 11:26:07 +0200
committerErich Eckner <git@eckner.net>2018-04-14 11:26:07 +0200
commitfe6d0fe699202978b00191ab6803b67badc7ddae (patch)
tree302f14c278a40eb8ac299bdd0d13ded52189c8a5 /packages
parent2096b05a54237735b676ffe495eed7d7b07126f6 (diff)
packages/pkginfo.php: retrieve more json from mysql
Diffstat (limited to 'packages')
-rw-r--r--packages/pkginfo.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index bf5b406..e71951f 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -137,11 +137,16 @@
// query dependent packages
if (! $mysql_result = $mysql -> query(
- "SELECT " .
+ "SELECT DISTINCT " .
"`dependency_types`.`name` AS `dependency_type`," .
- "`repositories`.`name` AS `repos`," .
- "`architectures`.`name` AS `archs`," .
- "`binary_packages`.`pkgname` AS `pkgnames`" .
+ "`install_targets`.`name` AS `install_target`," .
+ "GROUP_CONCAT(" .
+ "CONCAT(\"\\\"\",`dependencies`.`id`,\"\\\": \",\"{\\n\"," .
+ "\" \\\"repo\\\": \\\"\",`repositories`.`name`,\"\\\",\\n\"," .
+ "\" \\\"arch\\\": \\\"\",`architectures`.`name`,\"\\\",\\n\"," .
+ "\" \\\"pkgname\\\": \\\"\",`binary_packages`.`pkgname`,\"\\\"\\n\"," .
+ "\"}\"" .
+ ")) AS `reqs`" .
" FROM `install_target_providers`" .
" JOIN `install_targets` ON `install_targets`.`id`=`install_target_providers`.`install_target`" .
" JOIN `dependencies` ON `install_target_providers`.`install_target`=`dependencies`.`depending_on`" .
@@ -152,13 +157,15 @@
" JOIN `repository_stability_relations` ON `repository_stability_relations`.`less_stable`=`repositories`.`stability`" .
" AND `repository_stability_relations`.`more_stable`=" . $mysql_content["repo_stability"] .
" WHERE `install_target_providers`.`package`=" . $mysql_content["id"] .
- " GROUP BY `install_targets`.`id`"
+ " GROUP BY `binary_packages`.`id`"
))
die_500("Query failed: " . $mysql->error);
$dependent = array();
- while ($row = $mysql_result -> fetch_assoc())
+ while ($row = $mysql_result -> fetch_assoc()) {
+ $row["reqs"] = json_decode($row["reqs"]);
$dependent[] = $row;
+ }
$content = array_merge($mysql_content,$json_content);