From 99485e324ffc9723e945ff67cac10aadb4716ad7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 14 Apr 2018 12:12:21 +0200 Subject: packages/pkginfo.php: dependencies and required bys should work now --- packages/pkginfo.php | 52 ++++++++++++++-------------------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) (limited to 'packages') diff --git a/packages/pkginfo.php b/packages/pkginfo.php index 01d4211..b8d280f 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -141,13 +141,9 @@ "SELECT DISTINCT " . "`dependency_types`.`name` AS `dependency_type`," . "`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`" . + "`repositories`.`name` AS `repo`," . + "`architectures`.`name` AS `arch`," . + "`binary_packages`.`pkgname`" . " 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`" . @@ -164,13 +160,13 @@ die_500("Query failed: " . $mysql->error); $dependent = array(); - while ($row = $mysql_result -> fetch_assoc()) { - $row["reqs"] = json_decode($row["reqs"]); + while ($row = $mysql_result -> fetch_assoc()) $dependent[] = $row; - } $content = array_merge($mysql_content,$json_content); + // query substitutes + if (! $mysql_result = $mysql -> query( "SELECT " . "`binary_packages`.`pkgname` AS `pkgname`," . @@ -289,9 +285,6 @@ if (count($elsewhere)>0) { "/> "/> - @@ -380,32 +373,15 @@ if (count($elsewhere)>0) { \n"; - if (count($dep["deps"]) > 1) { - print $dep["install_target"]; - print " ("; - }; - $first = true; - foreach ($dep["deps"] as $d_p) { - if (!$first) - print ",\n"; - $first = false; - print "".$d_p["pkgname"].""; - } - if (count($dep["deps"])>1) - print ")"; + if ($dep["install_target"] != $content["Name"]) + print $dep["install_target"] . " ("; + print "".$dep["pkgname"].""; + if ($dep["install_target"] != $content["Name"]) + print ")"; print "\n"; - }; - if ($dep["dependency_type"]!="run") - print " (" . $dep["dependency_type"] . ")\n"; - print "\n"; - - foreach ($dependent as $d) { - print "
  • " . $d["pkgname"] . "\n"; - if ($d["dependency_type"]=="make") - print " (make)\n"; -print " " . $d["install_target"]; + if ($dep["dependency_type"] != "run") + print " (" . $dep["dependency_type"] . ")\n"; print "
  • \n"; } ?> -- cgit v1.2.3
    Architecture: