xref: /OK3568_Linux_fs/external/xserver/doc/filter-xmlto.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2#
3# Run the xmlto command, filtering its output to
4# reduce the amount of useless warnings in the build log.
5#
6# Exit with the status of the xmlto process, not the status of the
7# output filtering commands
8#
9# This is a bit twisty, but avoids any temp files by using pipes for
10# everything. It routes the command output through file
11# descriptor 4 while sending the (numeric) exit status through
12# standard output.
13#
14(((("$@" 2>&1; echo $? >&3) |
15       grep -v overflows |
16       grep -v 'Making' |
17       grep -v 'hyphenation' |
18       grep -v 'Font.*not found' |
19       grep -v '/tmp/xml' |
20       grep -v Rendered >&4) 3>&1) |
21     (read status; exit $status)) 4>&1
22