From 23a11fd85e12e94d29ee6d33715ac49684867b16 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 4 Jan 2015 19:13:35 -0800 Subject: doc: Create a script to filter xmlto output This reduces the build log spam while still preserving the xmlto status to catch build failures correctly. Signed-off-by: Keith Packard Reviewed-by: Peter Hutterer --- doc/Makefile.am | 2 +- doc/filter-xmlto.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 doc/filter-xmlto.sh (limited to 'doc') diff --git a/doc/Makefile.am b/doc/Makefile.am index e6974fef1..b305f4db7 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -12,4 +12,4 @@ include $(top_srcdir)/devbook.am endif HAVE_XMLTO endif ENABLE_DEVEL_DOCS -EXTRA_DIST = smartsched +EXTRA_DIST = smartsched filter-xmlto.sh diff --git a/doc/filter-xmlto.sh b/doc/filter-xmlto.sh new file mode 100755 index 000000000..3596ed13a --- /dev/null +++ b/doc/filter-xmlto.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Run the xmlto command, filtering its output to +# reduce the amount of useless warnings in the build log. +# +# Exit with the status of the xmlto process, not the status of the +# output filtering commands +# +# This is a bit twisty, but avoids any temp files by using pipes for +# everything. It routes the command output through file +# descriptor 4 while sending the (numeric) exit status through +# standard output. +# +(((("$@" 2>&1; echo $? >&3) | + grep -v overflows | + grep -v 'Making' | + grep -v 'hyphenation' | + grep -v 'Font.*not found' | + grep -v '/tmp/xml' | + grep -v Rendered >&4) 3>&1) | + (read status; exit $status)) 4>&1 -- cgit v1.2.3