index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/get-assignment | 32 |
diff --git a/bin/get-assignment b/bin/get-assignment index 6abfaef..8b399a3 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -96,6 +96,7 @@ if ! verbose_flock -s -n 8; then fi clean_up() { + # shellcheck disable=SC2317 rm -rf --one-file-system "${tmp_dir}" } @@ -200,16 +201,15 @@ while [ -s "${work_dir}/forced-package-builds.${slave}" ]; do fi done -# a package with [all dependencies met (or unsuccessfully built) or which is part of a loop] -# and which is currently not being built, ordered by: +# a package with [all dependencies met (or unsuccessfully built) or which is part of a loop], +# which is currently not being built and which has the highest priority, ordered by: # 1: we requested it # 2: tool chain priority -# 3: its priority -# 4: was built the least times -# 5: architecture matches (or the slave is from the majority architecture) -# 6: is part of a loop -# 7: has the oldes package source -# 8: build_assignment id +# 3: was built the least times +# 4: architecture matches (or the slave is from the majority architecture) +# 5: is part of a loop +# 6: has the oldes package source +# 7: build_assignment id next_building=$( # shellcheck disable=SC2016 { @@ -260,6 +260,21 @@ next_building=$( printf ' AND `architectures`.`name` = from_base64("%s");\n' \ "${arch}" + printf 'SET @`max_priority`=(' + printf 'SELECT MAX(`build_assignments`.`priority`)' + printf ' FROM `considered_build_assignments`' + printf ' JOIN `build_assignments`' + printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' + printf ');\n' + + printf 'DELETE `considered_build_assignments`' + printf ' FROM `considered_build_assignments`' + printf ' JOIN `build_assignments`' + printf ' ON `build_assignments`.`id`=`considered_build_assignments`.`id`' + printf ' WHERE `build_assignments`.`priority`<@`max_priority`' + printf ';\n' + + printf 'INSERT IGNORE INTO `considered_build_assignments_2` (`id`)' printf ' SELECT `considered_build_assignments`.`id`' printf ' FROM `considered_build_assignments`;\n' @@ -539,7 +554,6 @@ next_building=$( # 1: in toolchain, should be built later # 2: not in toolchain printf 'IFNULL(`toolchain_query`.`priority`,2),' - printf '`build_assignments`.`priority` DESC,' printf 'IFNULL(`latest_failed_builds`.`count`,0),' printf 'IF(' printf '`architectures`.`id`=%s' \ |