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:
Diffstat (limited to 'bin/filter-build-logs')
-rwxr-xr-xbin/filter-build-logs61
1 files changed, 61 insertions, 0 deletions
diff --git a/bin/filter-build-logs b/bin/filter-build-logs
new file mode 100755
index 0000000..36f83f0
--- /dev/null
+++ b/bin/filter-build-logs
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# filter content of build-logs for display on the webserver
+
+# shellcheck source=conf/default.conf
+. "${0%/*}/../conf/default.conf"
+
+{
+ printf '%s\n' \
+ '<html>' \
+ '<head>' \
+ '<title>Output of namcap of successful builds</title>' \
+ '<link rel="stylesheet" type="text/css" href="/static/style.css">' \
+ '</head>' \
+ '<body>' \
+ '<table>'
+ printf '<tr>'
+ printf '<th>%s</th>' \
+ 'package' \
+ 'type' \
+ 'message'
+ printf '</tr>\n'
+ find "${build_log_directory}/success" -maxdepth 1 -name '*.build-log.gz' -printf '%p\n' | \
+ while read -r log; do
+ zcat "${log}" | \
+ sed -n '
+ /^Checking PKGBUILD$/{
+ :a
+ $!{
+ N
+ ba
+ }
+ p
+ }
+ '
+ done | \
+ sed '
+ /^Checking \(PKGBUILD\|\S\+\(-[^-]\+\)\{3\}\.pkg\.tar\.xz\)$/d
+ / on your system is a testing release$/d
+ ' | \
+ sort -u | \
+ while read -r a b c; do
+ b="${b%:}"
+ if [ "${b}" = 'E' ]; then
+ left='<font color="red">'
+ right='</font>'
+ else
+ unset left
+ unset right
+ fi
+ printf '<tr>'
+ printf '<td>%s</td>' \
+ "${left}${a}${right}" "${left}${b}${right}" "${left}${c}${right}"
+ printf '</tr>\n'
+ done
+ printf '%s\n' \
+ '</table>' \
+ '</body>' \
+ '</html>'
+} > \
+ "${webserver_directory}/namcap-outputs.html"