[libvirt] [PATCH] docs: Load libvirt_access*.xml from build dir

The xml files are generated in build directory and thus docs/newapi.xsl was not able to find them in a VPATH build. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/Makefile.am | 1 + docs/newapi.xsl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index c6a3ead..faf2a32 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ + --stringparam builddir $(abs_top_builddir) \ $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \ if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \ if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \ diff --git a/docs/newapi.xsl b/docs/newapi.xsl index 606d244..b1728ee 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -25,18 +25,20 @@ <!-- Build keys for all symbols --> <xsl:key name="symbols" match="/api/symbols/*" use="@name"/> + <xsl:param name="builddir" select=".."/> + <!-- the target directory for the HTML output --> <xsl:variable name="htmldir">html</xsl:variable> <xsl:variable name="href_base">../</xsl:variable> <xsl:variable name="acls"> - <xsl:copy-of select="document('../src/libvirt_access.xml')/aclinfo/api"/> + <xsl:copy-of select="document('{$builddir}/src/libvirt_access.xml')/aclinfo/api"/> </xsl:variable> <xsl:variable name="qemuacls"> - <xsl:copy-of select="document('../src/libvirt_access_qemu.xml')/aclinfo/api"/> + <xsl:copy-of select="document('{$builddir}/src/libvirt_access_qemu.xml')/aclinfo/api"/> </xsl:variable> <xsl:variable name="lxcacls"> - <xsl:copy-of select="document('../src/libvirt_access_lxc.xml')/aclinfo/api"/> + <xsl:copy-of select="document('{$builddir}/src/libvirt_access_lxc.xml')/aclinfo/api"/> </xsl:variable> <xsl:template name="aclinfo"> -- 1.8.3.2

On Fri, Sep 20, 2013 at 16:13:54 +0200, Jiri Denemark wrote:
The xml files are generated in build directory and thus docs/newapi.xsl was not able to find them in a VPATH build.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/Makefile.am | 1 + docs/newapi.xsl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am index c6a3ead..faf2a32 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ + --stringparam builddir $(abs_top_builddir) \ $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \ if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \ if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \ diff --git a/docs/newapi.xsl b/docs/newapi.xsl index 606d244..b1728ee 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -25,18 +25,20 @@ <!-- Build keys for all symbols --> <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
+ <xsl:param name="builddir" select=".."/>
Oh, actually, the above should have been select="'..'" as this is a string parameter. It should only matter when someone calls xsltproc by hand as the Makefile always overrides the default value. Jirka

On 09/20/2013 08:16 AM, Jiri Denemark wrote:
+++ b/docs/Makefile.am @@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ + --stringparam builddir $(abs_top_builddir) \
The makefile populates it without ''...
+ <xsl:param name="builddir" select=".."/>
as does your default...
Oh, actually, the above should have been select="'..'" as this is a string parameter. It should only matter when someone calls xsltproc by hand as the Makefile always overrides the default value.
<xsl:variable name="acls"> - <xsl:copy-of select="document('../src/libvirt_access.xml')/aclinfo/api"/> + <xsl:copy-of select="document('{$builddir}/src/libvirt_access.xml')/aclinfo/api"/>
and you are expanding {$builddir} _within_ a '' context. I'm assuming that as written, it expands to ('../src/...'), but if builddir is defined with "'..'", it would expand to (''..'/src/...'). So what am I missing (probably a misunderstanding on my part about how xslt variable expansion works)? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Sep 20, 2013 at 08:41:54AM -0600, Eric Blake wrote:
On 09/20/2013 08:16 AM, Jiri Denemark wrote:
+++ b/docs/Makefile.am @@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ + --stringparam builddir $(abs_top_builddir) \
The makefile populates it without ''...
+ <xsl:param name="builddir" select=".."/>
as does your default...
That's a mistake :-)
Oh, actually, the above should have been select="'..'" as this is a string parameter. It should only matter when someone calls xsltproc by hand as the Makefile always overrides the default value.
<xsl:variable name="acls"> - <xsl:copy-of select="document('../src/libvirt_access.xml')/aclinfo/api"/> + <xsl:copy-of select="document('{$builddir}/src/libvirt_access.xml')/aclinfo/api"/>
and you are expanding {$builddir} _within_ a '' context. I'm assuming that as written, it expands to ('../src/...'), but if builddir is defined with "'..'", it would expand to (''..'/src/...'). So what am I missing (probably a misunderstanding on my part about how xslt variable expansion works)?
Yeah, this is fine as written here. I'm not going to try to explain XSLT here because it is mostly inexplicable ;-) Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Fri, Sep 20, 2013 at 04:16:51PM +0200, Jiri Denemark wrote:
On Fri, Sep 20, 2013 at 16:13:54 +0200, Jiri Denemark wrote:
The xml files are generated in build directory and thus docs/newapi.xsl was not able to find them in a VPATH build.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/Makefile.am | 1 + docs/newapi.xsl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am index c6a3ead..faf2a32 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ + --stringparam builddir $(abs_top_builddir) \ $(srcdir)/newapi.xsl $(srcdir)/libvirt-api.xml ; fi && \ if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \ if $(XMLCATALOG) '$(XML_CATALOG_FILE)' "-//W3C//DTD XHTML 1.0 Strict//EN" \ diff --git a/docs/newapi.xsl b/docs/newapi.xsl index 606d244..b1728ee 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -25,18 +25,20 @@ <!-- Build keys for all symbols --> <xsl:key name="symbols" match="/api/symbols/*" use="@name"/>
+ <xsl:param name="builddir" select=".."/>
Oh, actually, the above should have been select="'..'" as this is a string parameter. It should only matter when someone calls xsltproc by hand as the Makefile always overrides the default value.
ACK with that change Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 09/20/2013 08:13 AM, Jiri Denemark wrote:
The xml files are generated in build directory and thus docs/newapi.xsl was not able to find them in a VPATH build.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/Makefile.am | 1 + docs/newapi.xsl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-)
ACK, once you resolve the default setting of builddir when not run by make, and once you fix a nit:
diff --git a/docs/Makefile.am b/docs/Makefile.am index c6a3ead..faf2a32 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -242,6 +242,7 @@ internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in $(AM_V_GEN)if [ -x $(XSLTPROC) ] ; then \ $(XSLTPROC) --nonet -o $(srcdir)/ \ + --stringparam builddir $(abs_top_builddir) \
I don't know if we are fully clean in the rest of our makefile, but in general, automake tries to allow $(abs_top_builddir) that contains spaces (it guarantees that there are NOT spaces in any name relative to $(builddir), where the idea is that some people build under '/home/full name/dir/'). Therefore, you should write this as '$(abs_top_builddir)'. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Fri, Sep 20, 2013 at 08:46:01 -0600, Eric Blake wrote:
On 09/20/2013 08:13 AM, Jiri Denemark wrote:
The xml files are generated in build directory and thus docs/newapi.xsl was not able to find them in a VPATH build.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- docs/Makefile.am | 1 + docs/newapi.xsl | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-)
ACK, once you resolve the default setting of builddir when not run by make, and once you fix a nit:
Both fixed and pushed, thanks. Jirka
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Jiri Denemark