From 2b7e78220229a008e07b75c2092b10698e304307 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 29 Sep 2017 18:31:45 +0200 Subject: [PATCH] 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. --- Rakefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 4bd9f3dab..5068cac5e 100644 --- a/Rakefile +++ b/Rakefile @@ -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