Rakefile: fail properly if DocBook stylesheet isn't found

xsltproc always exits with 0 even if it fails.
This commit is contained in:
Moritz Bunkus 2017-07-22 15:37:14 +02:00
parent 264cbfd1ab
commit fe6756147a

View File

@ -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|