[libvirt] [PATCH] docs: Create html documentation even if XHTML1 DTD is not available to validate

On a Debian system lacking the w3c-dtd-xhtml package the build fails with: $ make -C docs/ formatcaps.html make: Entering directory '/local/scratch/ianc/devel/libvirt.git/docs' Generating formatcaps.html.tmp I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd formatcaps.html.in:2: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ^ I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ../docs/sitemap.html.in:2: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ^ missing XHTML1 DTD rm formatcaps.html.tmp make: Leaving directory '/local/scratch/ianc/devel/libvirt.git/docs' $ ls docs/formatcaps* docs/formatcaps.html.in https://www.redhat.com/archives/libvir-list/2009-November/msg00413.html suggests that the XHTML1 DTD should not be a hard requirement and the docs should be generated but not validated if it is not available. Therefore when the DTD is not available arrange for the .html.tmp file to be propagated to the .html output. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Daniel Veillard <veillard@redhat.com> --- docs/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 5485ee9..c5ba688 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -232,7 +232,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \ $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \ || { rm $(srcdir)/$@ && exit 1; }; \ - else echo "missing XHTML1 DTD" ; fi ; fi + else echo "missing XHTML1 DTD"; cat $< > $(srcdir)/$@ ; fi ; fi %.php.tmp: %.php.in site.xsl page.xsl sitemap.html.in @if [ -x $(XSLTPROC) ] ; then \ @@ -258,7 +258,7 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in > /dev/null ; then \ SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \ $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \ - else echo "missing XHTML1 DTD" ; fi ; fi + else echo "missing XHTML1 DTD"; cat $< > $(srcdir)/$@ ; fi ; fi $(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl) $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ -- 2.1.1

On Fri, 2014-11-28 at 14:36 +0000, Ian Campbell wrote:
On a Debian system lacking the w3c-dtd-xhtml package the build fails
On a somewhat related note on a system without xsltproc configure succeeds but the build does not: $ make -C docs csharp.html make: Entering directory '/local/scratch/ianc/devel/libvirt.git/docs' missing XHTML1 DTD /bin/cat: csharp.html.tmp: No such file or directory Makefile:2353: recipe for target 'csharp.html' failed make: *** [csharp.html] Error 1 make: Leaving directory '/local/scratch/ianc/devel/libvirt.git/docs' This is because the %.html.tmp silently does nothing if xsltproc isn't available. (aside: the use of @ all over docs/Makefile.am makes it quite hard to diagnose this sort of issue...) Is it valid to just cp %.html.in in this case or is the xsltproc stuff doing something essential? If copying isn't valid then is the preference to fail at configure time if xsltproc cannot be found or to not build the docs? Ian.

On 28.11.2014 15:36, Ian Campbell wrote:
On a Debian system lacking the w3c-dtd-xhtml package the build fails with:
$ make -C docs/ formatcaps.html make: Entering directory '/local/scratch/ianc/devel/libvirt.git/docs' Generating formatcaps.html.tmp I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd formatcaps.html.in:2: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ^ I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ../docs/sitemap.html.in:2: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" ^ missing XHTML1 DTD rm formatcaps.html.tmp make: Leaving directory '/local/scratch/ianc/devel/libvirt.git/docs' $ ls docs/formatcaps* docs/formatcaps.html.in
https://www.redhat.com/archives/libvir-list/2009-November/msg00413.html suggests that the XHTML1 DTD should not be a hard requirement and the docs should be generated but not validated if it is not available.
Therefore when the DTD is not available arrange for the .html.tmp file to be propagated to the .html output.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Daniel Veillard <veillard@redhat.com> --- docs/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am index 5485ee9..c5ba688 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -232,7 +232,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \ $(XMLLINT) --catalogs --nonet --format --valid $< > $(srcdir)/$@ \ || { rm $(srcdir)/$@ && exit 1; }; \ - else echo "missing XHTML1 DTD" ; fi ; fi + else echo "missing XHTML1 DTD"; cat $< > $(srcdir)/$@ ; fi ; fi
%.php.tmp: %.php.in site.xsl page.xsl sitemap.html.in @if [ -x $(XSLTPROC) ] ; then \ @@ -258,7 +258,7 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in > /dev/null ; then \ SGML_CATALOG_FILES='$(XML_CATALOG_FILE)' \ $(XMLLINT) --catalogs --nonet --valid --noout $(srcdir)/html/*.html ; \ - else echo "missing XHTML1 DTD" ; fi ; fi + else echo "missing XHTML1 DTD"; cat $< > $(srcdir)/$@ ; fi ; fi
$(addprefix $(srcdir)/,$(devhelphtml)): $(srcdir)/libvirt-api.xml $(devhelpxsl) $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \
I believe that running xmllint on Linux is successful. It surely is on systems that are missing the package. ACKed and pushed. Michal
participants (3)
-
Ian Campbell
-
Ian Campbell
-
Michal Privoznik