summaryrefslogtreecommitdiff
path: root/buildmaster/mysql-issues.php
diff options
context:
space:
mode:
Diffstat (limited to 'buildmaster/mysql-issues.php')
-rw-r--r--buildmaster/mysql-issues.php183
1 files changed, 183 insertions, 0 deletions
diff --git a/buildmaster/mysql-issues.php b/buildmaster/mysql-issues.php
new file mode 100644
index 0000000..1397141
--- /dev/null
+++ b/buildmaster/mysql-issues.php
@@ -0,0 +1,183 @@
+<?php
+require_once "../init.php";
+require_once BASE . "/lib/mysql.php";
+
+ $ignore = "";
+
+ if (isset($_GET["ignore-haskell"]))
+ $ignore .= " AND `install_targets`.`name` NOT LIKE \"libHS%\"";
+
+ if (isset($_GET["ignore-i486"]))
+ $ignore .= " AND `r_a`.`name` != \"i486\"";
+
+ ob_start();
+
+?>
+<html>
+ <head>
+ <title>More and less critical issues with the database</title>
+ <link rel="stylesheet" type="text/css" href="/static/style.css">
+ </head>
+ <body>
+<?php show_warning_on_offline_slave(); ?>
+ <a href="https://buildmaster.archlinux32.org/">Start page</a><br>
+<?php
+
+ $limit = " LIMIT 10001";
+
+ $result = mysql_run_query(
+ "SELECT CONCAT(" .
+ "`r_a`.`name`,\"/\"," .
+ "`repositories`.`name`,\"/\"," .
+ "`binary_packages`.`pkgname`,\"-\"," .
+ mysql_query_package_version("binary_packages") .
+ ",\"-\"," .
+ "`architectures`.`name`) AS `pkgfile`," .
+ "`install_targets`.`name` AS `install_target`," .
+ "IF(`binary_packages_in_repositories`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`," .
+ "`subst_r`.`name` AS `subst_repository`," .
+ "`subst_buildlist_bp`.`id` AS `subst_buildlist`" .
+ " FROM `binary_packages`" .
+ mysql_join_binary_packages_binary_packages_in_repositories() .
+ mysql_join_binary_packages_in_repositories_repositories() .
+ " AND `repositories`.`is_on_master_mirror`" .
+ mysql_join_repositories_architectures('','r_a') .
+ mysql_join_binary_packages_dependencies() .
+ mysql_join_dependencies_dependency_types() .
+ " AND `dependency_types`.`relevant_for_binary_packages`" .
+ mysql_join_dependencies_install_targets() .
+ mysql_join_binary_packages_architectures() .
+ " LEFT JOIN (" .
+ "`binary_packages` AS `subst_bp`" .
+ mysql_join_binary_packages_binary_packages_in_repositories('subst_bp','subst_bpir') .
+ mysql_join_binary_packages_in_repositories_repositories('subst_bpir','subst_r') .
+ " JOIN `repository_stability_relations` ON `repository_stability_relations`.`less_stable`=`subst_r`.`stability`" .
+ ")" .
+ " ON `subst_bp`.`pkgname`=`binary_packages`.`pkgname`" .
+ " AND `subst_bp`.`id`!=`binary_packages`.`id`" .
+ " AND `repository_stability_relations`.`more_stable`=`repositories`.`stability`" .
+ " AND `subst_r`.`architecture`=`repositories`.`architecture`" .
+ " LEFT JOIN (" .
+ "`binary_packages` AS `subst_buildlist_bp`" .
+ mysql_join_binary_packages_binary_packages_in_repositories('subst_buildlist_bp','subst_buildlist_bpir') .
+ mysql_join_binary_packages_in_repositories_repositories('subst_buildlist_bpir','subst_buildlist_r') .
+ " AND `subst_buildlist_r`.`name`=\"build-list\"".
+ ") ON `subst_buildlist_bp`.`pkgname`=`binary_packages`.`pkgname`" .
+ " AND `subst_bp`.`architecture`=`binary_packages`.`architecture`" .
+ " WHERE NOT EXISTS (" .
+ "SELECT 1 FROM `install_target_providers`" .
+ mysql_join_install_target_providers_binary_packages_in_repositories('','i_bpir') .
+ mysql_join_binary_packages_in_repositories_repositories('i_bpir','i_r') .
+ " JOIN `architecture_compatibilities` ON `architecture_compatibilities`.`fully_compatible`" .
+ " AND `architecture_compatibilities`.`built_for`=`i_r`.`architecture`" .
+ " WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`" .
+ " AND `repositories`.`architecture`=`architecture_compatibilities`.`runs_on`" .
+ ")" .
+ $ignore .
+ " ORDER BY " .
+ "`binary_packages_in_repositories`.`is_to_be_deleted`," .
+ "`repositories`.`name`," .
+ "`binary_packages`.`pkgname`," .
+ "`install_targets`.`name`" .
+ $limit
+ );
+
+ if ($result -> num_rows > 10000)
+ print " Found >10000 serious issues.<br>\n";
+ else
+ print " Found " . $result -> num_rows . " serious issues.<br>\n";
+
+ while ( $row = $result -> fetch_assoc() ) {
+ if ($row["is_to_be_deleted"]==1)
+ print " <font color=\"#00ff00\">(marked as to-be-deleted) ";
+ else
+ print " <font color=\"#ff0000\">";
+ print $row["pkgfile"] . " depends on " . htmlspecialchars($row["install_target"]) . " which is not provided by any package";
+ if (isset($row["subst_repository"]))
+ print " - but can be replaced by the one in " . $row["subst_repository"];
+ elseif (isset($row["subst_buildlist"]))
+ print " - but is already rescheduled";
+ print ".<br>";
+ print "</font>\n";
+ unset($row);
+ }
+
+ $result = mysql_run_query(
+ "SELECT CONCAT(" .
+ "`r_a`.`name`,\"/\"," .
+ "`repositories`.`name`,\"/\"," .
+ "`binary_packages`.`pkgname`,\"-\"," .
+ mysql_query_package_version("binary_packages") .
+ ",\"-\"," .
+ "`architectures`.`name`) AS `pkgfile`," .
+ "`install_targets`.`name` AS `install_target`," .
+ "`repository_stabilities`.`name` AS `stability`," .
+ "IF(`binary_packages_in_repositories`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`" .
+ " FROM `binary_packages`" .
+ mysql_join_binary_packages_binary_packages_in_repositories() .
+ mysql_join_binary_packages_in_repositories_repositories() .
+ " AND `repositories`.`is_on_master_mirror`" .
+ mysql_join_repositories_architectures('','r_a') .
+ mysql_join_repositories_repository_stabilities() .
+ mysql_join_binary_packages_dependencies() .
+ mysql_join_dependencies_dependency_types() .
+ " AND `dependency_types`.`relevant_for_binary_packages`" .
+ mysql_join_dependencies_install_targets() .
+ mysql_join_binary_packages_architectures() .
+ " WHERE EXISTS (" .
+ "SELECT 1 FROM `install_target_providers`" .
+ mysql_join_install_target_providers_binary_packages_in_repositories('','prov_bpir') .
+ mysql_join_binary_packages_in_repositories_repositories('prov_bpir','prov_r') .
+ " JOIN `architecture_compatibilities` ON `architecture_compatibilities`.`built_for`=`prov_r`.`architecture`" .
+ " AND `architecture_compatibilities`.`fully_compatible`" .
+ " WHERE `install_target_providers`.`install_target` = `dependencies`.`depending_on`" .
+ " AND `architecture_compatibilities`.`runs_on`=`repositories`.`architecture`" .
+ ")" .
+ " AND NOT EXISTS (" .
+ "SELECT 1 FROM `install_target_providers`" .
+ mysql_join_install_target_providers_binary_packages('','prov_bp') .
+ mysql_join_binary_packages_binary_packages_in_repositories('prov_bp','prov_bpir') .
+ mysql_join_binary_packages_in_repositories_repositories('prov_bpir','prov_r') .
+ " JOIN `repository_stability_relations` ON `prov_r`.`stability`=`repository_stability_relations`.`more_stable`" .
+ " WHERE `install_target_providers`.`install_target` = `dependencies`.`depending_on`" .
+ " AND `repositories`.`stability`=`repository_stability_relations`.`less_stable`" .
+ " AND `repositories`.`architecture`=`prov_r`.`architecture`" .
+ " AND NOT EXISTS (" .
+ "SELECT 1 FROM `binary_packages` AS `sup_bp`" .
+ mysql_join_binary_packages_binary_packages_in_repositories('sup_bp','sup_bpir') .
+ mysql_join_binary_packages_in_repositories_repositories('sup_bpir','sup_r') .
+ " JOIN `repository_stability_relations` AS `sup_rra` ON `sup_r`.`stability`=`sup_rra`.`more_stable`" .
+ " JOIN `repository_stability_relations` AS `sup_rrb` ON `sup_r`.`stability`=`sup_rrb`.`less_stable`" .
+ " WHERE `sup_bp`.`pkgname` = `prov_bp`.`pkgname`" .
+ " AND `sup_bp`.`architecture` = `prov_bp`.`architecture`" .
+ " AND `sup_bp`.`id` != `prov_bp`.`id`" .
+ " AND `repositories`.`stability`=`sup_rra`.`less_stable`" .
+ " AND `prov_r`.`stability`=`sup_rrb`.`more_stable`" .
+ " AND `prov_r`.`architecture`=`sup_r`.`architecture`" .
+ ")" .
+ ")" .
+ $ignore .
+ " ORDER BY `binary_packages_in_repositories`.`is_to_be_deleted`,`binary_packages`.`pkgname`,`install_targets`.`name`" .
+ $limit
+ );
+
+ if ($result -> num_rows > 10000)
+ print " Found >10000 stability issues.<br>\n";
+ else
+ print " Found " . $result -> num_rows . " stability issues.<br>\n";
+
+ while ( $row = $result -> fetch_assoc() ) {
+ if ($row["is_to_be_deleted"]==1)
+ print " <font color=\"#00ff00\">(marked as to-be-deleted) ";
+ else
+ print " <font color=\"#800000\">";
+ print $row["pkgfile"] . " depends on " . htmlspecialchars($row["install_target"]) . " which is not provided by any package installable from enabled " . $row["stability"] . " repositories.<br>";
+ print "</font>\n";
+ unset($row);
+ }
+
+ ob_end_flush();
+
+?>
+ </body>
+</html>