From cb4eedcdca4fc5f58e83abe2aadc9abb59b4918c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 24 Jan 2018 13:31:57 +0100 Subject: web-scripts/broken-packages.php: count loops and check if dependencies are met --- web-scripts/broken-packages.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/web-scripts/broken-packages.php b/web-scripts/broken-packages.php index 515f19a..268e296 100644 --- a/web-scripts/broken-packages.php +++ b/web-scripts/broken-packages.php @@ -19,7 +19,20 @@ $result = $mysql -> query( "`package_sources`.`pkgbase`," . "`package_sources`.`git_revision`," . "`package_sources`.`mod_git_revision`," . - "`upstream_repositories`.`name` " . + "`upstream_repositories`.`name`," . + "EXISTS (SELECT * " . + "FROM `binary_packages` `broken_bin` " . + "JOIN `dependencies` ON `dependencies`.`dependent` = `broken_bin`.`id` " . + "JOIN `install_target_providers` ON `install_target_providers`.`install_target` = `dependencies`.`depending_on` " . + "JOIN `binary_packages` `to_be_built` ON `to_be_built`.`id` = `install_target_providers`.`package` " . + "JOIN `repositories` ON `to_be_built`.`repository` = `repositories`.`id` " . + "WHERE `broken_bin`.`build_assignment`=`build_assignments`.`id` ". + "AND `repositories`.`name`=\"community-testing\"" . + ") AS `dependencies_pending`," . + "(SELECT count(*) " . + "FROM `build_dependency_loops` " . + "WHERE `build_dependency_loops`.`build_assignment`=`build_assignments`.`id`" . + ") AS `loops` " . "FROM `build_assignments` " . "JOIN `package_sources` ON `build_assignments`.`package_source` = `package_sources`.`id` " . "JOIN `upstream_repositories` ON `package_sources`.`upstream_package_repository` = `upstream_repositories`.`id` " . @@ -31,6 +44,8 @@ if ($result -> num_rows > 0) { while($row = $result->fetch_assoc()) { +foreach ($row as $key => $val) + $fail_result = $mysql -> query( "SELECT " . "`fail_reasons`.`name`, " . @@ -61,7 +76,12 @@ if ($result -> num_rows > 0) { $rows[$count]["fail_reasons"]=" "; } + $rows[$count]["loops"] = $row["loops"]; $rows[$count]["pkgbase"] = $row["pkgbase"]; + if ($row["dependencies_pending"]=="1") + $rows[$count]["pkgbase_print"] = "(" . $rows[$count]["pkgbase"] . ")"; + else + $rows[$count]["pkgbase_print"] = $rows[$count]["pkgbase"]; $rows[$count]["git_revision"] = $row["git_revision"]; $rows[$count]["mod_git_revision"] = $row["mod_git_revision"]; $rows[$count]["name"] = $row["name"]; @@ -106,6 +126,7 @@ if ($result -> num_rows > 0) { print "modification git revision"; print "package repository"; print "compilations"; + print "loops"; // print "dependent"; print "build error"; print "blocked"; @@ -115,11 +136,12 @@ if ($result -> num_rows > 0) { print ""; - print "".$row["pkgbase"].""; + print "".$row["pkgbase_print"].""; print "

".$row["git_revision"]."

"; print "

".$row["mod_git_revision"]."

"; print "".$row["name"].""; print "".$row["print_trials"].""; + print "".$row["loops"].""; // 0 print "".$row["fail_reasons"].""; print "".$row["is_blocked"].""; -- cgit v1.2.3-70-g09d2