Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/slave-build-connect
diff options
context:
space:
mode:
Diffstat (limited to 'bin/slave-build-connect')
-rwxr-xr-xbin/slave-build-connect15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/slave-build-connect b/bin/slave-build-connect
index aadf4df..46f9351 100755
--- a/bin/slave-build-connect
+++ b/bin/slave-build-connect
@@ -19,9 +19,14 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \
fi
# shellcheck disable=SC2016
- slave_id=$(
+ infos=$(
{
- printf 'SELECT `build_slaves`.`id` FROM `build_slaves`'
+ printf 'SELECT'
+ printf ' `build_slaves`.`id`,'
+ printf ' `persons`.`name`'
+ printf ' FROM `build_slaves`'
+ mysql_join_build_slaves_ssh_keys
+ mysql_join_ssh_keys_persons
printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
"$(
printf '%s' "$1" | \
@@ -30,10 +35,12 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \
} | \
mysql_run_query
)
- if [ -z "${slave_id}" ]; then
+ if [ -z "${infos}" ]; then
>&2 printf 'Build slave "%s" is unnknown to the database.\n' "$1"
exit 42
fi
+ slave_id="${infos%% *}"
+ operator="${infos#* }"
# shellcheck disable=SC2016
{
@@ -53,7 +60,7 @@ if [ "x${SSH_ORIGINAL_COMMAND%% *}" = 'xget-assignment' ] || \
} | \
mysql_run_query 'unimportant'
- slave="$1" slave_id="${slave_id}" /bin/sh -c "${base_dir}/bin/${SSH_ORIGINAL_COMMAND}"
+ slave="$1" slave_id="${slave_id}" operator="${operator}" /bin/sh -c "${base_dir}/bin/${SSH_ORIGINAL_COMMAND}"
else