diff options
-rwxr-xr-x | bin/get-assignment | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/bin/get-assignment b/bin/get-assignment index f6491fc..91bb407 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -257,24 +257,29 @@ next_building=$( # delete all non-toolchain packages from considered list iff any # toolchain package is on that list - printf 'DELETE `considered_build_assignments`' + printf 'CREATE TEMPORARY TABLE `toolchain_architectures` (' + printf '`id` SMALLINT NOT NULL,' + printf 'PRIMARY KEY (`id`)' + printf ');\n' + printf 'INSERT IGNORE INTO `toolchain_architectures` (`id`)' + printf ' SELECT `build_assignments`.`architecture`' printf ' FROM `considered_build_assignments`' printf ' JOIN `build_assignments`' printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' mysql_join_build_assignments_package_sources - printf ' WHERE NOT EXISTS (' - printf 'SELECT 1' - printf ' FROM `toolchain_order`' - printf ' WHERE `toolchain_order`.`pkgbase`=`package_sources`.`pkgbase`' - printf ') AND EXISTS (' - printf 'SELECT 1' - printf ' FROM `considered_build_assignments_2`' - printf ' JOIN `build_assignments`' - printf ' ON `build_assignments`.`id`=`considered_build_assignments_2`.`id`' - mysql_join_build_assignments_package_sources - printf ' JOIN `toolchain_order`' - printf ' ON `toolchain_order`.`pkgbase`=`package_sources`.`pkgbase`' - printf ');\n' + printf ' JOIN `toolchain_order`' + printf ' ON `toolchain_order`.`pkgbase`=`package_sources`.`pkgbase`;\n' + + printf 'DELETE `considered_build_assignments`' + printf ' FROM `toolchain_architectures`' + printf ' JOIN `build_assignments`' + printf ' ON `build_assignments`.`architecture`=`toolchain_architectures`.`id`' + 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 ' WHERE `toolchain_order`.`number` IS NULL;\n' printf 'DELETE `considered_build_assignments_2`' printf ' FROM `considered_build_assignments_2`;\n' @@ -293,21 +298,18 @@ next_building=$( # - exists unblocked before does not exist unblocked printf 'DELETE `considered_build_assignments`' printf ' FROM `considered_build_assignments`' -# TODO: this should be architecture specific - printf ' WHERE EXISTS (' - printf 'SELECT 1' - printf ' FROM `considered_build_assignments_2`' - printf ' JOIN `build_assignments`' - printf ' ON `build_assignments`.`id`=`considered_build_assignments_2`.`id`' - mysql_join_build_assignments_package_sources - printf ' JOIN `toolchain_order`' - printf ' ON `toolchain_order`.`pkgbase`=`package_sources`.`pkgbase`' - printf ');\n' + printf ' JOIN `build_assignments`' + printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' + printf ' JOIN `toolchain_architectures`' + printf ' ON `build_assignments`.`architecture`=`toolchain_architectures`.`id`;\n' + printf 'INSERT IGNORE INTO `considered_build_assignments` (`id`)' printf 'SELECT `considered_build_assignments_2`.`id`' printf ' FROM `considered_build_assignments_2`' printf ' JOIN `build_assignments`' printf ' ON `build_assignments`.`id`=`considered_build_assignments_2`.`id`' + printf ' JOIN `toolchain_architectures`' + printf ' ON `build_assignments`.`architecture`=`toolchain_architectures`.`id`' mysql_join_build_assignments_package_sources printf ' ORDER BY' # does it exist toolchain-blocked? |