From 89787bc77d751ad66f87c6fe56fe616216d12562 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 7 Nov 2017 08:42:59 +0100 Subject: bin/build-master-status: create link to FS more fuzzily --- bin/build-master-status | 72 +++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/bin/build-master-status b/bin/build-master-status index aa5e031..0a575f2 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -350,41 +350,43 @@ if ${web}; then )" \ "${build_error}" if [ -f "${work_dir}/package-states/${sf}.blocked" ]; then - 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' ' ' + sed ' + s|\s\(wait for \)|\n\1|g + ' "${work_dir}/package-states/${sf}.blocked" | \ + 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 | \ + tr '\n' ' ' else printf ' ' fi -- cgit v1.2.3-54-g00ecf