From 62791f8500bad684a3e74f5ea88851f485c21143 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 12 Sep 2018 09:47:57 +0200 Subject: packages/pkginfo.php: do not (totally) break on any packages in multiple repositories of different architectures --- packages/pkginfo.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/pkginfo.php b/packages/pkginfo.php index ad127e5..58d74c1 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -19,7 +19,7 @@ require_once BASE . "/lib/style.php"; $json_content = $json_content["package"]; $mysql_result = mysql_run_query( - "SELECT DISTINCT " . + "SELECT " . "`binary_packages`.`id`," . "`binary_packages`.`pkgname`," . "`package_sources`.`pkgbase`," . @@ -36,7 +36,7 @@ require_once BASE . "/lib/style.php"; "`git_repositories`.`name` AS `git_repo`," . "`package_sources`.`uses_upstream`," . "`package_sources`.`uses_modification`," . - "`binary_packages_in_repositories`.`last_moved`," . + "MAX(`binary_packages_in_repositories`.`last_moved`)," . "`sr`.`name` AS `stable_repo`" . " FROM `binary_packages`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . @@ -56,7 +56,8 @@ require_once BASE . "/lib/style.php"; "SELECT 1" . " FROM `repository_moves` AS `rm`" . " WHERE `rm`.`from_repository`=`sr`.`id`" . - ")" + ")" . + " GROUP BY `binary_packages`.`id`" ); if ($mysql_result -> num_rows != 1) -- cgit v1.2.3-70-g09d2