summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-01-22 08:52:35 +0100
committerErich Eckner <git@eckner.net>2018-01-22 08:52:35 +0100
commit44e86866de30f7c9caaf0af1e4c632af61d95812 (patch)
tree60a1e27ea10b8407d1fa867feeb40e306779ca2c /bin/return-assignment
parent4697dbe5bb3d088a1007a3d39274a1522e832fc4 (diff)
downloadbuilder-44e86866de30f7c9caaf0af1e4c632af61d95812.tar.xz
bin/return-assignment: mark packages in correct repository in database
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment23
1 files changed, 15 insertions, 8 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 48c6914..c47b01c 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -368,21 +368,28 @@ if ! [ "${destination}" = 'build-support' ]; then
printf '%s\n' ${packages} > \
"${work_dir}/package-states/$1.$2.$3.$4.done"
fi
-# TODO: mark packages in correct repository in database
-${mysql_command} -e "$(
- # shellcheck disable=SC2016
+# shellcheck disable=SC2016
+{
printf 'UPDATE `build_assignments`'
- # shellcheck disable=SC2016
printf ' JOIN `build_slaves` ON `build_slaves`.`currently_building`=`build_assignments`.`id`'
- # shellcheck disable=SC2016
- printf ' SET `build_assignments`.`is_broken`=0, `build_slaves`.`currently_building`=NULL'
- # shellcheck disable=SC2016
+ printf ' JOIN `binary_packages` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`'
+ printf ' SET'
+ printf ' `build_assignments`.`is_broken`=0,'
+ printf ' `build_slaves`.`currently_building`=NULL,'
+ printf ' `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`=from_base64("%s")),' \
+ "$(
+ printf '%s' "${destination}" | \
+ base64 -w0
+ )"
+ printf ' `binary_packages`.`has_issues`=0,'
+ printf ' `binary_packages`.`is_tested`=0'
printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
"$(
printf '%s' "${slave}" | \
base64 -w0
)"
-)"
+} | \
+ ${mysql_command}
rm -f \
"${work_dir}/package-states/$1.$2.$3.$4.locked" \
"${work_dir}/package-states/$1.$2.$3.$4.broken"