[PATCH macros v2] Fix XORG_WITH_XMLTO to work with xmlto >= 0.0.27

Gaetan Nadon memsize at videotron.ca
Wed Jan 13 16:51:55 PST 2016


On 16-01-12 07:59 AM, Andreas Boll wrote:
> Starting with xmlto version 0.0.27 the return code of
>   xmlto --skip-validation txt conftest.xml
> is non-zero if conftest.xml is an empty file.
>
> As a consequence the macro XORG_WITH_XMLTO returns
>   "xmlto cannot generate text format, this format skipped"
> and therefore libraries like libxi, libxdmcp and others won't convert
> docbook XML to text format.
>
> This changed behavior was introduced with the following change in xmlto:
>   xmlto.in: use correctly exit code from xsltproc
> See also: https://fedorahosted.org/xmlto/changeset/77
>
> This patch fixes this by additionally testing xmlto with a non-empty XML
> file.
>
> More details can be found at:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=613674
>
> Thanks to Peter Pearse, Helmut Grohne and Gaetan Nadon.
>
> v2: To maintain compatibility with older xorg tarballs don't replace
>     the original test with the empty XML file but instead add a fallback
>     to additionally test with a non-empty XML file if the original test fails.
>     Use the alternate solution with <x></x> to skip compatibility issues
>     with different docbook versions.
>
> Cc: Gaetan Nadon <memsize at videotron.ca>
> Signed-off-by: Andreas Boll <andreas.boll.dev at gmail.com>
> ---
> I've successfully tested this patch to build libxi with xmlto 0.0.26, 0.0.27
> and 0.0.28.
>
> To test this patch on a platform with only docbook version 5 installed
> I've replaced docbook-xml with docbook5-xml. On such a setup the macro
> XORG_WITH_XMLTO detects xmlto correctly though it fails later in the build
> with:
>
> xmlto: /«PKGBUILDDIR»/build/man/XAllowDeviceEvents.xml does not validate
> (status 3)
> xmlto: Fix document syntax or use --skip-validation option
> I/O error : Attempt to load network entity
> http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
> /«PKGBUILDDIR»/build/man/XAllowDeviceEvents.xml:2: warning: failed to
> load external entity
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
> D DocBook XML V4.5//EN"
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
>                                                        ^
> I/O error : Attempt to load network entity
> http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
> warning: failed to load external entity
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
> validity error : Could not load the external subset
> "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
> Document /«PKGBUILDDIR»/build/man/XAllowDeviceEvents.xml does not
> validate
>
> This build failure is expected since docbook version 5 is not backward
> compatible to version 4 and XORG_WITH_XMLTO doesn't check for a specific
> docbook version.
>
>  xorg-macros.m4.in | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)


Reviewed-by: Gaetan Nadon <memsize at videotron.ca>

I am no longer subscribed to the list


More information about the xorg-devel mailing list