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-assignment44
1 files changed, 44 insertions, 0 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 804501b..926cc69 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -146,6 +146,50 @@ if [ -n "${currently_building}" ]; then
hand_out_assignment "${currently_building}"
fi
+# shellcheck disable=SC2154
+if [ -s "${work_dir}/forced-package-builds.${slave}" ]; then
+ next_building=$(
+ sed -i '
+ 1 {
+ w /dev/stdout
+ d
+ }
+ ' "${work_dir}/forced-package-builds.${slave}"
+ )
+ if [ ! -s "${work_dir}/forced-package-builds.${slave}" ]; then
+ rm "${work_dir}/forced-package-builds.${slave}"
+ fi
+ if [ -n "${next_building}" ]; then
+ next_building=$(
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT'
+ printf ' `build_assignments`.`id`'
+ printf ' FROM `build_assignments`'
+ mysql_join_build_assignments_binary_packages
+ mysql_join_binary_packages_binary_packages_in_repositories
+ printf ' AND `binary_packages_in_repositories`.`repository`=%s' \
+ "${repository_ids__any_build_list}"
+ mysql_join_build_assignments_package_sources
+ mysql_join_build_assignments_architectures
+ printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \
+ "$(
+ printf '%s' "${next_building#* }" | \
+ base64 -w0
+ )"
+ printf ' AND `architectures`.`name`=from_base64("%s")' \
+ "$(
+ printf '%s' "${next_building%% *}" | \
+ base64 -w0
+ )"
+ printf ' LIMIT 1;\n'
+ } | \
+ mysql_run_query
+ )
+ hand_out_assignment "${next_building}"
+ fi
+fi
+
# a package with [all dependencies met or which is part of a loop]
# and which is currently not being built, ordered by:
# 1: we requested it