From fe6756147a162278373535929487bea27aa7e2da Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 22 Jul 2017 15:37:14 +0200 Subject: [PATCH] Rakefile: fail properly if DocBook stylesheet isn't found xsltproc always exits with 0 even if it fails. --- Rakefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 7679fa4bc..f8832ec5e 100644 --- a/Rakefile +++ b/Rakefile @@ -317,7 +317,14 @@ rule '.1' => '.xml' do |t| result end - runq "xsltproc", t.source, "#{c(:XSLTPROC)} #{c(:XSLTPROC_FLAGS)} -o #{t.name} #{c(:DOCBOOK_ROOT)}/manpages/docbook.xsl #{t.sources.join(" ")}", :filter_output => filter + stylesheet = "#{c(:DOCBOOK_ROOT)}/manpages/docbook.xsl" + + if !FileTest.exists?(stylesheet) + puts "Error: the DocBook stylesheet '#{stylesheet}' does not exist." + exit 1 + end + + runq "xsltproc", t.source, "#{c(:XSLTPROC)} #{c(:XSLTPROC_FLAGS)} -o #{t.name} #{stylesheet} #{t.sources.join(" ")}", :filter_output => filter end $manpages.each do |manpage|