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:
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'