From 3e6fcf6de305ad2b3adf567ff6ffe6906d9b46f4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 16 Nov 2018 15:26:39 +0100 Subject: packages/pkginfo.php: add links to split packages --- packages/pkginfo.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'packages/pkginfo.php') diff --git a/packages/pkginfo.php b/packages/pkginfo.php index 882c766..9fe7a1c 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -29,6 +29,7 @@ require_once BASE . "/lib/style.php"; "SELECT " . "`binary_packages`.`id`," . "`binary_packages`.`pkgname`," . + "`sp_q`.`split_packages`," . "`package_sources`.`pkgbase`," . "CONCAT(" . "IF(`binary_packages`.`epoch`=\"0\",\"\",CONCAT(`binary_packages`.`epoch`,\":\"))," . @@ -56,6 +57,27 @@ require_once BASE . "/lib/style.php"; mysql_join_upstream_repositories_git_repositories() . mysql_join_upstream_repositories_repository_moves() . " JOIN `repositories` AS `sr` ON `sr`.`id`=`repository_moves`.`to_repository`" . + " JOIN (" . + "SELECT DISTINCT `binary_packages`.`build_assignment`," . + "GROUP_CONCAT(" . + "CONCAT(" . + "\"\\\"\",`binary_packages`.`id`,\"\\\": {" . + "\\\"pkgname\\\":" . + " \\\"\",`binary_packages`.`pkgname`,\"\\\"," . + "\\\"repository\\\":" . + " \\\"\",`repositories`.`name`,\"\\\"," . + "\\\"repo_arch\\\":" . + " \\\"\",`architectures`.`name`,\"\\\"" . + "}\"" . + ")" . + ") AS `split_packages`" . + " FROM `binary_packages`" . + mysql_join_binary_packages_binary_packages_in_repositories() . + mysql_join_binary_packages_in_repositories_repositories() . + mysql_join_repositories_architectures() . + " GROUP BY `binary_packages`.`build_assignment`" . + ") AS `sp_q`" . + " ON `sp_q`.`build_assignment`=`build_assignments`.`id`" . " WHERE `binary_packages`.`pkgname`=from_base64(\"" . base64_encode($_GET["pkgname"]) . "\")" . " AND `architectures`.`name`=from_base64(\"" . base64_encode($_GET["arch"]) . "\")" . " AND `repositories`.`name`=from_base64(\"" . base64_encode($_GET["repo"]) . "\")" . @@ -71,6 +93,7 @@ require_once BASE . "/lib/style.php"; throw_http_error(404, "Package Not Found In Buildmaster's Database"); $mysql_content = $mysql_result -> fetch_assoc(); + $mysql_content["split_packages"] = array_map("unserialize", array_unique(array_map("serialize", json_decode("{".$mysql_content["split_packages"]."}",true)))); if (!$skip_json_checks) { $same_keys = array ( @@ -430,6 +453,33 @@ if (count($elsewhere)>0) { " title="Browse the repository"> + 1) { + print " \n"; + print " \n"; + print " Split Packages:\n"; + print " \n"; + print " \n"; + foreach ($content["split_packages"] as $split_package) { + print " "; + if ($split_package["pkgname"] != $content["pkgname"]) { + print ""; + } + print $split_package["pkgname"]; + $count --; + if ($split_package["pkgname"] != $content["pkgname"]) + print ""; + if ($count > 0) + print ", "; + } + print " \n"; + print " \n"; +} +?> Description: -- cgit v1.2.3-70-g09d2