From 548ddb5ec85ea7474a213ca065939fc2b8553f5e Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 5 Jun 2018 10:01:12 +0200 Subject: bin/get-assignment: build_assignments.id is retrieved from the db before - no need to base64_encode --- bin/get-assignment | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'bin') diff --git a/bin/get-assignment b/bin/get-assignment index c8fcbaf..af86ea1 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -34,10 +34,10 @@ hand_out_assignment() { mysql_join_package_sources_build_assignments mysql_join_build_assignments_binary_packages mysql_join_binary_packages_binary_packages_in_repositories - mysql_join_binary_packages_in_repositories_repositories - printf ' WHERE `repositories`.`name`="build-list"' - printf ' AND `build_assignments`.`id`=from_base64("%s")' \ - "$(printf '%s' "$1" | base64 -w0)" + printf ' WHERE `binary_packages_in_repositories`.`repository`=%s' \ + "${repository_ids__any_build_list}" + printf ' AND `build_assignments`.`id`=%s' \ + "$1" printf ' LIMIT 1;\n' } | \ mysql_run_query | \ @@ -46,16 +46,16 @@ hand_out_assignment() { # shellcheck disable=SC2016 { printf 'UPDATE `build_slaves`' - printf ' SET `currently_building` = from_base64("%s")' \ - "$(printf '%s' "$1" | base64 -w0)" + printf ' SET `currently_building`=%s' \ + "$1" # shellcheck disable=SC2154 printf ' WHERE `build_slaves`.`id`=from_base64("%s");\n' \ "$(printf '%s' "${slave_id}" | base64 -w0)" printf 'UPDATE `build_assignments`' printf ' SET `build_assignments`.`priority`=0' - printf ' WHERE `build_assignments`.`id`=from_base64("%s");\n' \ - "$(printf '%s' "${slave_id}" | base64 -w0)" + printf ' WHERE `build_assignments`.`id`=%s;\n' \ + "$1" } | \ mysql_run_query -- cgit v1.2.3-70-g09d2