xserver-multidpi/doc/filter-xmlto.sh
Keith Packard 23a11fd85e 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 <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-01-05 14:24:06 -08:00

22 lines
680 B
Bash
Executable File

#!/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