From 857bd3fa11b0680f1a1ca482948ecc0a1110a478 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 30 May 2018 13:37:54 +0200 Subject: do not read `binary_packages`.`repository` --- buildmaster/build-list.php | 6 ++++-- buildmaster/deletion-links.php | 3 ++- buildmaster/dependencies.php | 15 ++++++++++----- buildmaster/mysql-issues.php | 16 ++++++++++------ buildmaster/to-delete.php | 5 +++-- packages/index.php | 6 ++++-- packages/pkginfo.php | 18 ++++++++++++------ 7 files changed, 45 insertions(+), 24 deletions(-) diff --git a/buildmaster/build-list.php b/buildmaster/build-list.php index 08eba57..b4eec1b 100644 --- a/buildmaster/build-list.php +++ b/buildmaster/build-list.php @@ -184,7 +184,8 @@ $result = mysql_run_query( " JOIN `upstream_repositories` ON `package_sources`.`upstream_package_repository` = `upstream_repositories`.`id`" . " JOIN `git_repositories` ON `upstream_repositories`.`git_repository`=`git_repositories`.`id`" . " JOIN `binary_packages` ON `binary_packages`.`build_assignment` = `build_assignments`.`id`" . - " JOIN `repositories` ON `binary_packages`.`repository` = `repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id` = `binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository` = `repositories`.`id`" . " WHERE `repositories`.`name`=\"build-list\"" . ") AS `ba_q`". " LEFT JOIN" . @@ -197,7 +198,8 @@ $result = mysql_run_query( " JOIN `dependency_types` ON `dependencies`.`dependency_type` = `dependency_types`.`id`" . " JOIN `install_target_providers` ON `install_target_providers`.`install_target` = `dependencies`.`depending_on` " . " JOIN `binary_packages` AS `dependency_bp` ON `dependency_bp`.`id` = `install_target_providers`.`package` " . - " JOIN `repositories` ON `dependency_bp`.`repository` = `repositories`.`id` " . + " JOIN `binary_packages_in_repositories` ON `dependency_bp`.`id` = `binary_packages_in_repositories`.`package` " . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository` = `repositories`.`id` " . " WHERE `dependency_bp`.`build_assignment` != `dependent_bp`.`build_assignment`" . " AND `dependency_types`.`relevant_for_building`" . " AND `repositories`.`name`=\"build-list\"" . diff --git a/buildmaster/deletion-links.php b/buildmaster/deletion-links.php index f6e3222..58673e8 100644 --- a/buildmaster/deletion-links.php +++ b/buildmaster/deletion-links.php @@ -61,7 +61,8 @@ $result = mysql_run_query( " FROM `binary_packages`" . " JOIN `d_bp` ON `d_bp`.`id`=`binary_packages`.`id`" . " JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`bianry_packages_in_repositories`.`package`" + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" ); while ($row = $result->fetch_assoc()) diff --git a/buildmaster/dependencies.php b/buildmaster/dependencies.php index 34328f3..dddb662 100644 --- a/buildmaster/dependencies.php +++ b/buildmaster/dependencies.php @@ -37,7 +37,8 @@ mysql_run_query( "INSERT IGNORE INTO `cons` (`dep`,`itp`)" . " SELECT `dependencies`.`id`,`install_target_providers`.`id`". " FROM `binary_packages`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `repository_stabilities` ON `repositories`.`stability`=`repository_stabilities`.`id`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . " JOIN `build_assignments` ON `binary_packages`.`build_assignment`= `build_assignments`.`id`" . @@ -56,7 +57,8 @@ mysql_run_query( "INSERT IGNORE INTO `cons` (`dep`,`itp`)" . " SELECT `dependencies`.`id`,`install_target_providers`.`id`". " FROM `binary_packages`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . " JOIN `build_assignments` ON `binary_packages`.`build_assignment`= `build_assignments`.`id`" . " JOIN `package_sources` ON `build_assignments`.`package_source`= `package_sources`.`id`" . @@ -64,7 +66,8 @@ mysql_run_query( " JOIN `install_target_providers` ON `install_target_providers`.`package`=`binary_packages`.`id`" . " JOIN `dependencies` ON `install_target_providers`.`install_target`=`dependencies`.`depending_on`" . " JOIN `binary_packages` AS `d_bp` ON `dependencies`.`dependent`=`d_bp`.`id`" . - " JOIN `repositories` AS `d_r` ON `d_bp`.`repository`=`d_r`.`id`" . + " JOIN `binary_packages_in_repositories` as `d_bpir` ON `d_bp`.`id`=`d_bpir`.`package`" . + " JOIN `repositories` AS `d_r` ON `d_bpir`.`repository`=`d_r`.`id`" . " JOIN `repository_stabilities` AS `d_rs` ON `d_r`.`stability`=`d_rs`.`id`" . " JOIN `dependency_types` ON `dependencies`.`dependency_type`=`dependency_types`.`id`" . " WHERE (`dependency_types`.`relevant_for_binary_packages` OR `d_rs`.`name`=\"unbuilt\")" . @@ -123,7 +126,8 @@ $result = mysql_run_query( " JOIN `dependencies` ON `cons`.`dep`=`dependencies`.`id`" . " JOIN `binary_packages` ON `dependencies`.`dependent`=`binary_packages`.`id`" . " JOIN `architectures` ON `architectures`.`id`=`binary_packages`.`architecture`" . - " JOIN `repositories` ON `repositories`.`id`=`binary_packages`.`repository`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `repository_stabilities` ON `repository_stabilities`.`id`=`repositories`.`stability`" ); @@ -139,7 +143,8 @@ $result = mysql_run_query( " JOIN `install_target_providers` ON `cons`.`itp`=`install_target_providers`.`id`" . " JOIN `binary_packages` ON `install_target_providers`.`package`=`binary_packages`.`id`" . " JOIN `architectures` ON `architectures`.`id`=`binary_packages`.`architecture`" . - " JOIN `repositories` ON `repositories`.`id`=`binary_packages`.`repository`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `repository_stabilities` ON `repository_stabilities`.`id`=`repositories`.`stability`" ); diff --git a/buildmaster/mysql-issues.php b/buildmaster/mysql-issues.php index 7dde0f4..e6e557d 100644 --- a/buildmaster/mysql-issues.php +++ b/buildmaster/mysql-issues.php @@ -21,7 +21,8 @@ "`subst_r`.`name` AS `subst_repository`," . "`subst_buildlist_bp`.`id` AS `subst_buildlist`" . " FROM `binary_packages`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " AND `repositories`.`is_on_master_mirror`" . " JOIN `dependencies` ON `dependencies`.`dependent`=`binary_packages`.`id`" . " JOIN `dependency_types` ON `dependencies`.`dependency_type`=`dependency_types`.`id`" . @@ -29,15 +30,16 @@ " JOIN `install_targets` ON `dependencies`.`depending_on`=`install_targets`.`id`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . " LEFT JOIN (`binary_packages` AS `subst_bp`" . - " JOIN `repositories` AS `subst_r` ON `subst_bp`.`repository`=`subst_r`.`id`" . + " JOIN `binary_packages_in_repositories` as `subst_bpir` ON `subst_bp`.`id`=`subst_bpir`.`package`" . + " JOIN `repositories` AS `subst_r` ON `subst_bpir`.`repository`=`subst_r`.`id`" . " JOIN `repository_stability_relations` ON `repository_stability_relations`.`less_stable`=`subst_r`.`id`" . ")" . " ON `subst_bp`.`pkgname`=`binary_packages`.`pkgname`" . " AND `subst_bp`.`id`!=`binary_packages`.`id`" . " AND `repository_stability_relations`.`more_stable`=`repositories`.`id`" . " LEFT JOIN (`binary_packages` AS `subst_buildlist_bp`" . - " JOIN `repositories` AS `subst_buildlist_r`" . - " ON `subst_buildlist_bp`.`repository`=`subst_buildlist_r`.`id`" . + " JOIN `binary_packages_in_repositories` AS `subst_buildlist_bpir` ON `subst_buildlist_bp`.`id`=`subst_buildlist_bpir`.`package`" . + " JOIN `repositories` AS `subst_buildlist_r` ON `subst_buildlist_bpir`.`repository`=`subst_buildlist_r`.`id`" . " AND `subst_buildlist_r`.`name`=\"build-list\"". ") ON `subst_buildlist_bp`.`pkgname`=`binary_packages`.`pkgname`" . " WHERE NOT EXISTS (" . @@ -69,7 +71,8 @@ "`repository_stabilities`.`name` AS `stability`," . "IF(`binary_packages`.`is_to_be_deleted`,1,0) AS `is_to_be_deleted`" . " FROM `binary_packages`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " AND `repositories`.`is_on_master_mirror`" . " JOIN `repository_stabilities` ON `repositories`.`stability`=`repository_stabilities`.`id`" . " JOIN `dependencies` ON `dependencies`.`dependent`=`binary_packages`.`id`" . @@ -84,7 +87,8 @@ " AND NOT EXISTS (" . "SELECT * FROM `install_target_providers`" . " JOIN `binary_packages` AS `prov_bp` ON `prov_bp`.`id`=`install_target_providers`.`package`" . - " JOIN `repositories` AS `prov_r` ON `prov_bp`.`repository`=`prov_r`.`id`" . + " JOIN `binary_packages_in_repositories` AS `prov_bpir` ON `prov_bp`.`id`=`prov_bpir`.`package`" . + " JOIN `repositories` AS `prov_r` ON `prov_bpir`.`repository`=`prov_r`.`id`" . " 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`" . diff --git a/buildmaster/to-delete.php b/buildmaster/to-delete.php index e4d8e67..67d9a28 100644 --- a/buildmaster/to-delete.php +++ b/buildmaster/to-delete.php @@ -13,9 +13,10 @@ "`architectures`.`name` AS `arch` " . "FROM `binary_packages` " . "JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id` " . - "JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id` " . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . "WHERE `binary_packages`.`is_to_be_deleted` " . - "AND NOT `repositories`.`name` IN (\"build-support\",\"build-list\",\"deletion-list\")" + "AND `repositories`.`is_on_master_mirror`" ); ?> diff --git a/packages/index.php b/packages/index.php index 53bfb1d..d09d75f 100644 --- a/packages/index.php +++ b/packages/index.php @@ -64,7 +64,8 @@ $query = " FROM `binary_packages`" . " JOIN `architectures` ON `architectures`.`id`=`binary_packages`.`architecture`" . - " JOIN `repositories` ON `repositories`.`id`=`binary_packages`.`repository`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " AND `repositories`.`is_on_master_mirror`" . " JOIN `build_assignments` ON `build_assignments`.`id`=`binary_packages`.`build_assignment`" . $filter . $exact_filter . @@ -136,7 +137,8 @@ $query = " FROM `binary_packages`" . " JOIN `architectures` ON `architectures`.`id`=`binary_packages`.`architecture`" . - " JOIN `repositories` ON `repositories`.`id`=`binary_packages`.`repository`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " AND `repositories`.`is_on_master_mirror`" . " JOIN `build_assignments` ON `build_assignments`.`id`=`binary_packages`.`build_assignment`" . $filter . $fuzzy_filter . diff --git a/packages/pkginfo.php b/packages/pkginfo.php index c7539e5..7c483f1 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -37,7 +37,8 @@ "`binary_packages`.`last_moved`" . " FROM `binary_packages`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `repository_stabilities` ON `repositories`.`stability`=`repository_stabilities`.`id`" . " JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`" . " JOIN `package_sources` ON `build_assignments`.`package_source`=`package_sources`.`id`" . @@ -90,14 +91,16 @@ "`install_target_providers`" . " JOIN `binary_packages` ON `install_target_providers`.`package`=`binary_packages`.`id`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `repository_stability_relations` ON `repository_stability_relations`.`more_stable`=`repositories`.`stability`" . " AND `repository_stability_relations`.`less_stable`=" . $mysql_content["repo_stability"] . ") ON `install_target_providers`.`install_target`=`dependencies`.`depending_on`" . " WHERE `dependencies`.`dependent`=" . $mysql_content["id"] . " AND NOT EXISTS (" . "SELECT 1 FROM `binary_packages` AS `subst_bp`" . - " JOIN `repositories` AS `subst_r` ON `subst_bp`.`repository`=`subst_r`.`id`" . + " JOIN `binary_packages_in_repositories` AS `subst_bpir` ON `subst_bp`.`id`=`subst_bpir`.`package`" . + " JOIN `repositories` AS `subst_r` ON `subst_bpir`.`repository`=`subst_r`.`id`" . // the substitue must be truly less stable than the dependency " JOIN `repository_stability_relations` AS `subst_rsr` ON `subst_rsr`.`less_stable`=`subst_r`.`stability`" . " AND `subst_rsr`.`less_stable`!=`subst_rsr`.`more_stable`" . @@ -176,13 +179,15 @@ " JOIN `dependency_types` ON `dependency_types`.`id`=`dependencies`.`dependency_type`" . " JOIN `binary_packages` ON `dependencies`.`dependent`=`binary_packages`.`id`" . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `repository_stability_relations` ON `repository_stability_relations`.`less_stable`=`repositories`.`stability`" . " AND `repository_stability_relations`.`more_stable`=" . $mysql_content["repo_stability"] . " WHERE `install_target_providers`.`package`=" . $mysql_content["id"] . " AND NOT EXISTS (" . "SELECT 1 FROM `binary_packages` AS `subst_bp`" . - " JOIN `repositories` AS `subst_r` ON `subst_bp`.`repository`=`subst_r`.`id`" . + " JOIN `binary_packages_in_repositories` AS `subst_bpir` ON `subst_bp`.`id`=`subst_bpir`.`package`" . + " JOIN `repositories` AS `subst_r` ON `subst_bpir`.`repository`=`subst_r`.`id`" . // the substitue must be truly less stable than we " JOIN `repository_stability_relations` AS `subst_rsr` ON `subst_rsr`.`less_stable`=`subst_r`.`stability`" . " AND `subst_rsr`.`less_stable`!=`subst_rsr`.`more_stable`" . @@ -225,7 +230,8 @@ ") AS `version`" . " FROM `binary_packages` " . " JOIN `architectures` ON `binary_packages`.`architecture`=`architectures`.`id`" . - " JOIN `repositories` ON `binary_packages`.`repository`=`repositories`.`id`" . + " JOIN `binary_packages_in_repositories` ON `binary_packages`.`id`=`binary_packages_in_repositories`.`package`" . + " JOIN `repositories` ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . " JOIN `binary_packages` AS `original`" . " ON `binary_packages`.`pkgname`=`original`.`pkgname`" . " AND `binary_packages`.`id`!=`original`.`id`" . -- cgit v1.2.3-70-g09d2