Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-06-17 21:46:56 +0200
committerErich Eckner <git@eckner.net>2023-06-17 21:46:56 +0200
commit5d1d1fb1ae445a073275925e943603f9a942f55d (patch)
tree95e4a6249b1827577b3e653f0ab5c2500ce046b0 /bin
parent8c0b7a60382994b7f96c0996f23567b3646bed78 (diff)
bin/get-assignment: change ordering
* only consider packages with highest priority * should make "forced-package-builds-*" obsolete
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get-assignment24
1 files changed, 14 insertions, 10 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 25281e6..37b430f 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -201,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
{
@@ -222,6 +221,11 @@ next_building=$(
printf ');\n'
done
+ printf 'SET @`max_priority`=('
+ printf 'SELECT MAX(`build_assignments`.`priority`)'
+ printf ' FROM `build_assignments`'
+ printf ');\n'
+
printf 'INSERT IGNORE INTO `considered_build_assignments` (`id`)'
printf ' SELECT `build_assignments`.`id`'
printf ' FROM `build_assignments`'
@@ -243,7 +247,8 @@ next_building=$(
printf ')'
printf ' LEFT'
mysql_join_package_sources_toolchain_order
- printf ' WHERE ('
+ printf ' WHERE `build_assignments`.`priority`=@`max_priority`'
+ printf ' AND ('
printf '`build_assignments`.`is_blocked` IS NULL'
if [ -n "${requested}" ]; then
printf ' OR'
@@ -540,7 +545,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' \