Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/filter-build-logs
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-10-20 14:19:48 +0200
committerErich Eckner <git@eckner.net>2017-10-20 14:19:48 +0200
commit954e1958d1583ca805bd7d71708a777ee85b47df (patch)
tree00e056887f9032dcd26b670eba295e9d28bf8b37 /bin/filter-build-logs
parent634cbe38944851fd74afb351d982adbdd522ae3b (diff)
bin/filter-build-logs: make colorized output
Diffstat (limited to 'bin/filter-build-logs')
-rwxr-xr-xbin/filter-build-logs28
1 files changed, 19 insertions, 9 deletions
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 @@
'<table>'
printf '<tr>'
printf '<th>%s</th>' \
+ '&nbsp;' \
'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='<font color="red">'
- right='</font>'
+ 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 '<tr>'
- printf '<td>%s</td>' \
- "${left}${a}${right}" "${left}${b}${right}" "${left}${c}${right}"
+ printf '<td><font color="#'"${color}"'">%s</font></td>' \
+ "${a}" "${b}" "${c}" "${d}"
printf '</tr>\n'
done
printf '%s\n' \