From 410b16c77a441a99915d44d5fe5b3c4ba2e04517 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 19 Jul 2019 09:39:03 +0200 Subject: bin/get-assignment: use mysql_join_toolchain_order_package_sources() and mysql_join_package_sources_toolchain_order() instead of hand-crafted joins --- bin/get-assignment | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'bin/get-assignment') diff --git a/bin/get-assignment b/bin/get-assignment index 53b2c8f..a66b5d4 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -274,8 +274,8 @@ next_building=$( printf ' JOIN `build_assignments`' printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' mysql_join_build_assignments_package_sources - printf ' JOIN `toolchain_order`' - printf ' ON `toolchain_order`.`pkgbase`=`package_sources`.`pkgbase`;\n' + mysql_join_package_sources_toolchain_order + printf ';\n' printf 'DELETE `considered_build_assignments`' printf ' FROM `toolchain_architectures`' @@ -284,8 +284,8 @@ next_building=$( printf ' JOIN `considered_build_assignments`' printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' mysql_join_build_assignments_package_sources - printf ' LEFT JOIN `toolchain_order`' - printf ' ON `toolchain_order`.`pkgbase`=`package_sources`.`pkgbase`' + printf ' LEFT' + mysql_join_package_sources_toolchain_order printf ' WHERE `toolchain_order`.`number` IS NULL;\n' printf 'DELETE `considered_build_assignments_2`' @@ -332,8 +332,7 @@ next_building=$( printf ' JOIN `toolchain_order` AS `early`' printf ' ON `late`.`pkgbase`!=`early`.`pkgbase`' printf ' AND `late`.`number`>`early`.`number`' - printf ' JOIN `package_sources` AS `e_ps`' - printf ' ON `e_ps`.`pkgbase`=`early`.`pkgbase`' + mysql_join_toolchain_order_package_sources 'early' 'e_ps' mysql_join_package_sources_build_assignments 'e_ps' 'e_ba' printf ' JOIN `considered_build_assignments_3` AS `e_cba`' printf ' ON `e_cba`.`id`=`e_ba`.`id`' @@ -360,8 +359,7 @@ next_building=$( printf ' WHERE NOT EXISTS (' printf 'SELECT 1' printf ' FROM `toolchain_order` AS `early`' - printf ' JOIN `package_sources` AS `e_ps`' - printf ' ON `e_ps`.`pkgbase`=`early`.`pkgbase`' + mysql_join_toolchain_order_package_sources 'early' 'e_ps' mysql_join_package_sources_build_assignments 'e_ps' 'e_ba' printf ' JOIN `considered_build_assignments_4` AS `e_cba`' printf ' ON `e_ba`.`id`=`e_cba`.`id`' @@ -486,8 +484,7 @@ next_building=$( mysql_join_binary_packages_binary_packages_in_repositories 'block_bp' 'block_bpir' printf ' AND `block_bpir`.`repository`=%s' \ "${repository_ids__any_build_list}" - printf ' JOIN `toolchain_order` AS `early`' - printf ' ON `early`.`pkgbase`=`block_ps`.`pkgbase`' + mysql_join_package_sources_toolchain_order 'block_ps' 'early' printf ' WHERE `early`.`number`<`late`.`number`' printf ' AND `early`.`pkgbase`!=`late`.`pkgbase`' printf ' AND (' @@ -503,8 +500,7 @@ next_building=$( printf ')' printf ') AS `is_blocked`' printf ' FROM `toolchain_order` AS `late`' - printf ' JOIN `package_sources`' - printf ' ON `package_sources`.`pkgbase`=`late`.`pkgbase`' + mysql_join_toolchain_order_package_sources 'late' mysql_join_package_sources_build_assignments mysql_join_build_assignments_binary_packages mysql_join_binary_packages_binary_packages_in_repositories -- cgit v1.2.3-70-g09d2