From 09983e35984755339ce379e41d6f9dcd5587f7bf Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 9 Oct 2021 10:25:30 +0100 Subject: check: Add support for newer pandoc without pandoc-citeproc Signed-off-by: Daniel Silverstone --- check | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/check b/check index 601f900..b7c5164 100755 --- a/check +++ b/check @@ -90,6 +90,11 @@ class Runcmd: p = self.runcmd_unchecked(["which", name], stdout=DEVNULL) return p.returncode == 0 + def pandoc_is_newer(self): + """Is pandoc new enough for --citeproc""" + p = self.runcmd(["pandoc", "--help"], stdout=PIPE) + return "--citeproc" in p.stdout.decode("UTF-8") + def cargo(self, args, **kwargs): """Run cargo with arguments.""" self.runcmd(["cargo"] + args, **kwargs) @@ -329,6 +334,10 @@ def check_tooling(r): ] for command in commands: if not r.got_command(command): + if command == "pandoc-citeproc": + if r.pandoc_is_newer(): + r.msg(" Fortunately pandoc is new enough for --citeproc, no need for pandoc-citeproc") + continue sys.exit(f"can't find {command}, which is needed for test suite") if not r.got_command("daemonize") and not r.got_command("/usr/sbin/daemonize"): -- cgit v1.2.1