Rakefile: fix reporting xsltproc errors

Older versions used to exit with code 0 even in the case of an
error. Newer versions exit with <> 0. Handle that case and output the
emitted lines.
This commit is contained in:
Moritz Bunkus 2017-09-29 18:31:45 +02:00
parent 977e362303
commit 2b7e782202

View File

@ -314,15 +314,19 @@ end
# man pages from DocBook XML
rule '.1' => '.xml' do |t|
filter = lambda do |code, lines|
if (0 == code) && lines.any? { |line| /^error/i.match(line) }
if (0 == code) && lines.any? { |line| /^error|parser error/i.match(line) }
File.unlink(t.name) if File.exists?(t.name)
result = 1
elsif 0 != code
result = code
puts lines.join('')
else
result = 0
puts lines.join('') if $verbose
end
puts lines.join('') if $verbose
result
end