index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-06-05 11:00:49 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-05 11:00:49 +0200 |
commit | cfb2186ac775752ba45d66f372ac367694fc4f31 (patch) | |
tree | 19a126f1d1c98f80584d19d52dd51f14daf31268 /bin/ping-from-slave | |
parent | 45546b6a31e900d78fe2c0344636a2d132633e4f (diff) |
-rwxr-xr-x | bin/ping-from-slave | 41 |
diff --git a/bin/ping-from-slave b/bin/ping-from-slave index a82a633..a12129f 100755 --- a/bin/ping-from-slave +++ b/bin/ping-from-slave @@ -30,25 +30,28 @@ if [ -z "${status}" ]; then fi if [ "${status% *}" != '1' ]; then - >&2 echo 'You do not build anything currently - abort whatever you are doing.' - if [ "${status#* }" = '1' ]; then - # shellcheck disable=SC2016 - { - printf 'UPDATE `build_slaves`' - printf ' SET `build_slaves`.`is_sane`=0' - printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ - "$(printf '%s' "${slave}" | base64 -w0)" - printf 'SELECT CONCAT(' - printf '`persons`.`name`,": Your buildslave \\"",' - printf '`build_slaves`.`name`,"\\" builds some outdated package."' - 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' "${slave}" | base64 -w0)" - } | \ - mysql_run_query | \ - irc_say + # during upload, the job might already have been deleted from the database + if [ 'uploading' != "$1" ]; then + >&2 echo 'You do not build anything currently - abort whatever you are doing.' + if [ "${status#* }" = '1' ]; then + # shellcheck disable=SC2016 + { + printf 'UPDATE `build_slaves`' + printf ' SET `build_slaves`.`is_sane`=0' + printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \ + "$(printf '%s' "${slave}" | base64 -w0)" + printf 'SELECT CONCAT(' + printf '`persons`.`name`,": Your buildslave \\"",' + printf '`build_slaves`.`name`,"\\" builds some outdated package."' + 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' "${slave}" | base64 -w0)" + } | \ + mysql_run_query | \ + irc_say + fi fi exit 2 fi |