From 7d1b1520e40a502f3dea06202bb0dcb7815e4fa0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 8 Oct 2018 08:57:43 +0200 Subject: bin/get-assignment: open backdoor to force specific package to be built next on specific slave --- bin/get-assignment | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'bin') 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 -- cgit v1.2.3-70-g09d2