From 7555ed7e9249ae3eefdb40954d37119d9c6fc03f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 1 Sep 2017 09:04:33 +0200 Subject: bin/build-master-status: colorize blocked-reasons --- bin/build-master-status | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'bin') 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]\+\)|FS#\1| - /FS#[0-9]\+/!s|^\(wait for \)\(\S\+\) $|\1\2 | - /FS#[0-9]\+/!s@^\(wait for \)\(\S\+\) \(or\|and\) \(\S\+\) $@\1\2 \3 \4 @ - ' + 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 '%s' \ + "${reason#FS#}" \ + "${reason}" + elif grep -q "^$(str_to_regex "${reason}") " "${work_dir}/build-list"; then + printf '%s' \ + "${reason}" \ + "${reason}" + elif [ "${reason% *}" != "${reason}" ]; then + printf '%s' \ + "${reason}" + else + printf '%s' \ + "${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 ' ' fi -- cgit v1.2.3-70-g09d2