]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: meson.build: Generate HTML files directly by meson
authorPeter Krempa <pkrempa@redhat.com>
Mon, 12 Oct 2020 14:13:08 +0000 (16:13 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 19 Oct 2020 10:40:50 +0000 (12:40 +0200)
Since we no longer reformat the XSLT-transformed files, there's no need
to use an external script any more.

Unfortunately this hid errors from 'xsltproc' as return value was not
checked and the stderr was piped into xmllints stdin. The result was
that any invalid input file would result into an empty output file.

Since the script's only purpose was to prevent additional temporary
files at the time we were reformatting the output in a pipeline we no
longer need this.

Moving the generation directly into the meson definition makes it more
obvious what's happening and saves readers from having to parse what's
going on. A free bonus is that errors are now properly caught and
reported.

This patch converts the main docs/ directory for now with cleanup of
other comming later.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
docs/meson.build

index d18e5c1feb60e06014ef74ef76b2636ee7456e3e..8b7c63bc6f2673f7a1025527132ec1430cba5106 100644 (file)
@@ -267,20 +267,17 @@ foreach data : docs_html_in_gen
     input: data['file'],
     output: html_file,
     command: [
-      meson_python_prog,
-      python3_prog.path(),
-      meson_html_gen_prog.path(),
-      xsltproc_prog.path(),
-      xmllint_prog.path(),
-      meson.build_root(),
-      docs_timestamp,
+      xsltproc_prog,
+      '--stringparam', 'pagesrc', data.get('source', ''),
+      '--stringparam', 'builddir', meson.build_root(),
+      '--stringparam', 'timestamp', docs_timestamp,
+      '--nonet',
       site_xsl,
       '@INPUT@',
-      '@OUTPUT@',
-      data.get('source', []),
     ],
     depends: data.get('depends', []),
     depend_files: [ page_xsl ],
+    capture: true,
     install: true,
     install_dir: docs_html_dir,
   )