From 4d3e330fedbf08be369fb5a148966362029137eb Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Sat, 6 Feb 2021 02:01:01 +0000 Subject: set --catalogs for xmllint if SGML_CATALOG_FILES env is set Backport of 289c42d179be0bf665cca9b618fb282384175c4f (#172) Signed-off-by: Matthew Peveler --- a2x.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/a2x.py b/a2x.py index 4715b48..2c26a94 100755 --- a/a2x.py +++ b/a2x.py @@ -699,7 +699,10 @@ class A2X(AttrDict): shell('"%s" --backend docbook -a "a2x-format=%s" %s --out-file "%s" "%s"' % (self.asciidoc, self.format, self.asciidoc_opts, docbook_file, self.asciidoc_file)) if not self.no_xmllint and XMLLINT: - shell('"%s" --nonet --noout --valid "%s"' % (XMLLINT, docbook_file)) + xmllint_options = ['--nonet', '--noout', '--valid'] + if 'SGML_CATALOG_FILES' in os.environ: + xmllint_options.append('--catalogs') + shell('"%s" %s "%s"' % (XMLLINT, " ".join(xmllint_options), docbook_file)) def to_xhtml(self): self.to_docbook() -- cgit v1.2.1