xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Mon Jan 5 14:24:25 PST 2015


 devbook.am          |   10 ++++++----
 doc/Makefile.am     |    2 +-
 doc/filter-xmlto.sh |   21 +++++++++++++++++++++
 3 files changed, 28 insertions(+), 5 deletions(-)

New commits:
commit 23a11fd85e12e94d29ee6d33715ac49684867b16
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Jan 4 19:13:35 2015 -0800

    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 at keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/devbook.am b/devbook.am
index 400b2ca..edddc86 100644
--- a/devbook.am
+++ b/devbook.am
@@ -20,6 +20,8 @@ noinst_DATA =
 # DocBook/XML file with chapters, appendix and images it includes
 dist_noinst_DATA = $(docbook) $(chapters)
 
+FILTER_XMLTO=$(SHELL) $(top_srcdir)/doc/filter-xmlto.sh $(XMLTO)
+
 if HAVE_STYLESHEETS
 
 XMLTO_HTML_FLAGS = 					\
@@ -29,12 +31,12 @@ XMLTO_HTML_FLAGS = 					\
 
 noinst_DATA += $(docbook:.xml=.html)
 %.html: %.xml  $(chapters)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
+	$(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
 
 if HAVE_XMLTO_TEXT
 noinst_DATA += $(docbook:.xml=.txt)
 %.txt: %.xml $(chapters)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
+	$(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_HTML_FLAGS) txt $<
 endif HAVE_XMLTO_TEXT
 
 if HAVE_FOP
@@ -46,9 +48,9 @@ XMLTO_FO_FLAGS = 					\
 
 noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
 %.pdf: %.xml $(chapters)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
+	$(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
 %.ps: %.xml $(chapters)
-	$(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
+	$(AM_V_GEN)$(FILTER_XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
 endif HAVE_FOP
 endif HAVE_STYLESHEETS
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
index e6974fe..b305f4d 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 0000000..3596ed1
--- /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


More information about the xorg-commit mailing list