Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-06-18 21:57:50 +0200
committerErich Eckner <git@eckner.net>2023-06-18 21:57:50 +0200
commitfe75af7a3ff04e0327aa0425f9f6d6cae0925b1b (patch)
tree5d4d6ab67171a11b9d1b4de97b8faf6815fdcd88 /bin/get-assignment
parentd233eea6d04773c2ab3d86dc84f22bdf359110be (diff)
bin/get-assignment: take max priority of _considered_ build_assignments
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment23
1 files changed, 16 insertions, 7 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 37b430f..8b399a3 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -221,11 +221,6 @@ 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`'
@@ -247,8 +242,7 @@ next_building=$(
printf ')'
printf ' LEFT'
mysql_join_package_sources_toolchain_order
- printf ' WHERE `build_assignments`.`priority`=@`max_priority`'
- printf ' AND ('
+ printf ' WHERE ('
printf '`build_assignments`.`is_blocked` IS NULL'
if [ -n "${requested}" ]; then
printf ' OR'
@@ -266,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'