summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-09-01 09:04:33 +0200
committerErich Eckner <git@eckner.net>2017-09-01 09:04:33 +0200
commit7555ed7e9249ae3eefdb40954d37119d9c6fc03f (patch)
tree44a891e2daa4551a15ebc217cef8c4d7f52e3ff5 /bin
parentb695b160d891475a8d1f3fd050f9aec5deb33ba7 (diff)
downloadbuilder-7555ed7e9249ae3eefdb40954d37119d9c6fc03f.tar.xz
bin/build-master-status: colorize blocked-reasons
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build-master-status41
1 files changed, 35 insertions, 6 deletions
diff --git a/bin/build-master-status b/bin/build-master-status
index 49c28ac..e765c36 100755
--- a/bin/build-master-status
+++ b/bin/build-master-status
@@ -280,12 +280,41 @@ if ${web}; then
cut -d' ' -f2
)"
if [ -f "${work_dir}/package-states/${sf}.blocked" ]; then
- tr '\n' ' ' < "${work_dir}/package-states/${sf}.blocked" | \
- sed '
- s|FS#\([0-9]\+\)|<a href="https://bugs.archlinux.org/task/\1">FS#\1</a>|
- /FS#[0-9]\+/!s|^\(wait for \)\(\S\+\) $|\1<a href="graphs/\2.png">\2</a> |
- /FS#[0-9]\+/!s@^\(wait for \)\(\S\+\) \(or\|and\) \(\S\+\) $@\1<a href="graphs/\2.png">\2</a> \3 <a href="graphs/\4.png">\4</a> @
- '
+ while read -r blocked_reason; do
+ if echo "${blocked_reason}" | \
+ grep -q '^wait for '; then
+ printf 'wait for '
+ echo "${blocked_reason}" | \
+ sed '
+ s|^wait for ||
+ s@\( and \| or \)@\n\1\n@
+ ' | \
+ while read -r reason; do
+ if [ "FS#${reason#FS#}" = "${reason}" ]; then
+ printf '<a href="https://bugs.archlinux.org/task/%s">%s</a>' \
+ "${reason#FS#}" \
+ "${reason}"
+ elif grep -q "^$(str_to_regex "${reason}") " "${work_dir}/build-list"; then
+ printf '<a href="graphs/%s.png">%s</a>' \
+ "${reason}" \
+ "${reason}"
+ elif [ "${reason% *}" != "${reason}" ]; then
+ printf '%s' \
+ "${reason}"
+ else
+ printf '<font color="red">%s</font>' \
+ "${reason}"
+ fi
+ if read -r operator; then
+ printf ' %s ' "${operator}"
+ fi
+ done
+ else
+ echo "${blocked_reason}"
+ fi
+ done < \
+ "${work_dir}/package-states/${sf}.blocked" | \
+ tr '\n' ' '
else
printf '&nbsp;'
fi