diff options
author | Erich Eckner <git@eckner.net> | 2018-04-14 11:26:07 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-04-14 11:26:07 +0200 |
commit | fe6d0fe699202978b00191ab6803b67badc7ddae (patch) | |
tree | 302f14c278a40eb8ac299bdd0d13ded52189c8a5 /packages/pkginfo.php | |
parent | 2096b05a54237735b676ffe495eed7d7b07126f6 (diff) | |
download | archweb32-fe6d0fe699202978b00191ab6803b67badc7ddae.tar.xz |
packages/pkginfo.php: retrieve more json from mysql
Diffstat (limited to 'packages/pkginfo.php')
-rw-r--r-- | packages/pkginfo.php | 19 |
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); |