Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-03 13:39:50 +0100
committerErich Eckner <git@eckner.net>2018-02-03 13:39:50 +0100
commit37c1de524dad0a1363502ac2308f0091dd70b3d2 (patch)
tree9dcc66c6ddc566c3f58fa209fb98349fa88734d0
parent2cece122e1fa57ed5cce7f29108798ee1004d261 (diff)
bin/return-assignment: remove build assignment from other build slaves, too, if it was a successful one
-rwxr-xr-xbin/return-assignment8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 6c0ae16..bf27232 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -447,9 +447,11 @@ fi
printf '%s' "${slave}" | \
base64 -w0
)"
- printf 'UPDATE `build_slaves` SET'
- printf ' `build_slaves`.`currently_building`=NULL'
- printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
+ printf 'UPDATE `build_slaves` AS `to_update`'
+ printf ' JOIN `build_slaves` AS `current_slave`'
+ printf ' ON `to_update`.`currently_building`=`current_slave`.`currently_building`'
+ printf ' SET `to_update`.`currently_building`=NULL'
+ printf ' WHERE `current_slave`.`name`=from_base64("%s");\n' \
"$(
printf '%s' "${slave}" | \
base64 -w0