From fe6d0fe699202978b00191ab6803b67badc7ddae Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 14 Apr 2018 11:26:07 +0200 Subject: packages/pkginfo.php: retrieve more json from mysql --- packages/pkginfo.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'packages') 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); -- cgit v1.2.3-70-g09d2