[PATCH v2 4/9] docs: meson.build: Generate HTML files directly by meson

Peter Krempa pkrempa at redhat.com
Tue Oct 13 16:18:08 UTC 2020


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 at redhat.com>
---
 docs/meson.build | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/docs/meson.build b/docs/meson.build
index d18e5c1feb..8b7c63bc6f 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -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,
   )
-- 
2.26.2




More information about the libvir-list mailing list