From 954e1958d1583ca805bd7d71708a777ee85b47df Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 20 Oct 2017 14:19:48 +0200 Subject: bin/filter-build-logs: make colorized output --- bin/filter-build-logs | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'bin/filter-build-logs') diff --git a/bin/filter-build-logs b/bin/filter-build-logs index 48f9aeb..ac4f940 100755 --- a/bin/filter-build-logs +++ b/bin/filter-build-logs @@ -16,6 +16,7 @@ '' printf '' printf '' \ + ' ' \ 'package' \ 'type' \ 'message' @@ -25,20 +26,29 @@ /^Checking \(PKGBUILD\|\S\+\(-[^-]\+\)\{3\}\.pkg\.tar\.xz\)$/d / on your system is a testing release$/d s/^PKGBUILD\s\+(\([^) ]\+\))\s\+/\1 / + s/^./\0 / ' | \ sort -u | \ - while read -r a b c; do - b="${b%:}" - if [ "${b}" = 'E' ]; then - left='' - right='' + while read -r a b c d; do + c="${c%:}" + if [ "${c}" = 'E' ]; then + color='FF' else - unset left - unset right + color='80' fi + case "${a}" in + '+') + color="${color}0000" + ;; + '-') + color="00${color}00" + ;; + *) + color="0000${color}" + esac printf '' - printf '' \ - "${left}${a}${right}" "${left}${b}${right}" "${left}${c}${right}" + printf '' \ + "${a}" "${b}" "${c}" "${d}" printf '\n' done printf '%s\n' \ -- cgit v1.2.3
%s
%s%s