summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-01 09:05:51 +0100
committerErich Eckner <git@eckner.net>2018-03-01 09:05:51 +0100
commit496c571cd233a8646351ba241c3119ceaf2b8063 (patch)
tree3018e0a5a4ed78158c57a5b09d4b9e87fd3246d5 /bin/get-assignment
parent6047f2686cfe623e08fbaf4eae0a552ded731eb1 (diff)
downloadbuilder-496c571cd233a8646351ba241c3119ceaf2b8063.tar.xz
use "mysql -N" instead of cumbersome sedding
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment16
1 files changed, 5 insertions, 11 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index bc67fab..964c6b7 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -58,11 +58,8 @@ hand_out_assignment() {
"$(printf '%s' "$4" | base64 -w0)"
printf ' LIMIT 1;\n'
} | \
- mysql_run_query --raw --batch | \
- sed '
- 1d
- y/\t/ /
- '
+ mysql_run_query -N --raw --batch | \
+ tr '\t' ' '
{
# shellcheck disable=SC2154
@@ -157,8 +154,7 @@ currently_building=$(
printf ' AND `repositories`.`name`="build-list"'
printf ' LIMIT 1;\n'
} | \
- mysql_run_query --batch --raw | \
- sed '1d'
+ mysql_run_query -N --batch --raw
)
if [ -n "${currently_building}" ]; then
@@ -214,9 +210,8 @@ next_building=$(
printf ' ORDER BY `requested` DESC, `priority` DESC, `last_trial`, `part_of_loop`, `build_assignments`.`id`'
printf ' LIMIT 1;\n'
} | \
- mysql_run_query --batch --raw | \
+ mysql_run_query -N --batch --raw | \
sed '
- 1d
y/\t/ /
s/^.* \(\S\+\( \S\+\)\{3\}\)$/\1/
'
@@ -238,8 +233,7 @@ count_pending=$(
printf ' AND `build_assignments`.`is_blocked` IS NULL'
printf ';\n'
} | \
- mysql_run_query --batch --raw | \
- sed '1d'
+ mysql_run_query -N --batch --raw
)
if [ "${count_pending}" -eq 0 ]; then