summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-24 12:49:12 +0200
committerErich Eckner <git@eckner.net>2018-04-24 12:49:12 +0200
commitcefea1135f1a88ceb77f45758b07c0c824cd9d71 (patch)
treefeecf7ad44c7de3bda85b51df20f6758b0497985 /bin/return-assignment
parent2feb9e4eafea12167b337e29e96c04cdb0e52d42 (diff)
downloadbuilder-cefea1135f1a88ceb77f45758b07c0c824cd9d71.tar.xz
bin/return-assignment: do not try to add failures if none were identified
Diffstat (limited to 'bin/return-assignment')
-rwxr-xr-xbin/return-assignment7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 1b7a872..bcdb717 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -99,7 +99,6 @@ if [ "$5" = 'ERROR' ]; then
'log_file' 'VARCHAR(512)' | \
sed 's/,$//'
printf ');\n'
- printf 'INSERT INTO `failures` (`date`,`reason`,`log_file`) VALUES'
fail_reason_identifiers=$(
{
printf 'SELECT `fail_reasons`.`id`,replace(to_base64(`fail_reasons`.`identifier`),"\\n","")'
@@ -131,8 +130,10 @@ if [ "$5" = 'ERROR' ]; then
fi
done
done | \
- sed 's/,$//'
- printf ';\n'
+ sed '
+ 1 s/^/INSERT INTO `failures` (`date`,`reason`,`log_file`) VALUES /
+ s/,$/;\n/
+ '
printf 'INSERT INTO `failed_builds` (`build_slave`,`build_assignment`,`date`,`reason`,`log_file`)'
printf ' SELECT '
printf '`build_slaves`.`%s`,' \