From fcee643710f1fb2dcd035a7328badf24c06d6d99 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 29 Apr 2019 12:15:01 +0200 Subject: bin/bootstrap-mysql: caluclate_maximal_moveable_set now operates per-arch and per-stability --- bin/bootstrap-mysql | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bin/bootstrap-mysql') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 344c5a0..a142715 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -37,7 +37,10 @@ fi printf 'DELIMITER //\n' printf 'DROP PROCEDURE IF EXISTS `calculate_maximal_moveable_set`//\n' - printf 'CREATE PROCEDURE `calculate_maximal_moveable_set`(IN `from_stability` MEDIUMINT)\n' + printf 'CREATE PROCEDURE `calculate_maximal_moveable_set`(' + printf 'IN `arch_id` MEDIUMINT,' + printf 'IN `from_stability` MEDIUMINT' + printf ')\n' printf 'BEGIN\n' # variable to store count of changed rows printf 'DECLARE row_count_saved INT DEFAULT 0;\n' @@ -74,7 +77,9 @@ fi mysql_join_binary_packages_binary_packages_in_repositories 'b_bp' 'b_bpir' mysql_join_binary_packages_in_repositories_repositories 'b_bpir' 'b_r' printf ' WHERE `a_r`.`stability` = `from_stability`' - printf ' AND `b_r`.`stability` = `from_stability`;\n' + printf ' AND `a_r`.`architecture` = `arch_id`' + printf ' AND `b_r`.`stability` = `from_stability`' + printf ' AND `b_r`.`architecture` = `arch_id`;\n' # these packages are considered for moving: printf 'INSERT IGNORE INTO `moveable_bpir` (`id`,`to_repository`)' printf ' SELECT `binary_packages_in_repositories`.`id`,`repository_moves`.`to_repository`' @@ -89,6 +94,7 @@ fi printf ' AND `repository_moves`.`from_repository`=`binary_packages_in_repositories`.`repository`' # correct stability: "testing"/"staging" - as chosen printf ' WHERE `repository_stabilities`.`id`=`from_stability`' + printf ' AND `repositories`.`architecture`=`arch_id`' printf ' AND (' # this should not be replaced by ${repository_stability_ids__staging}, # because it may change @@ -108,7 +114,8 @@ fi mysql_join_build_assignments_binary_packages mysql_join_binary_packages_binary_packages_in_repositories mysql_join_binary_packages_in_repositories_repositories - printf ' WHERE `repositories`.`stability`=`from_stability`;\n' + printf ' WHERE `repositories`.`stability`=`from_stability`' + printf ' AND `repositories`.`architecture`=`arch_id`;\n' # these packages are considered for being replaced: # for each moved package -- cgit v1.2.3-70-g09d2