aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2013-10-08 12:12:48 +0100
committerMike McQuaid2013-10-08 12:13:06 +0100
commit90b7cfb5075af573b74752bddd7f40f3cce5c9de (patch)
tree4d4942c4ee1f5e758a7f39e9b45924e7bab2a5f0
parent8ec2d4594e2a49f04c7f6b64144f360da0ac57fd (diff)
downloadbrew-90b7cfb5075af573b74752bddd7f40f3cce5c9de.tar.bz2
brew-test-bot: cleanup junit file with iconv.
-rwxr-xr-xLibrary/Contributions/cmd/brew-test-bot.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/Library/Contributions/cmd/brew-test-bot.rb b/Library/Contributions/cmd/brew-test-bot.rb
index f035eddef..0488bc24f 100755
--- a/Library/Contributions/cmd/brew-test-bot.rb
+++ b/Library/Contributions/cmd/brew-test-bot.rb
@@ -397,10 +397,15 @@ end
if ARGV.include? "--junit"
xml_erb = HOMEBREW_CONTRIBUTED_CMDS + "brew-test-bot.xml.erb"
erb = ERB.new IO.read xml_erb
- open("brew-test-bot.xml", "w") do |xml|
- # Remove empty lines and null characters from ERB result.
- xml.write erb.result(binding).gsub(/^\s*$\n|\000/, '')
+ output_xml = 'brew-test-bot.xml'
+ input_xml = "#{output_xml}.in"
+ open("brew-test-bot.xml.in", "w") do |xml|
+ # Remove empty lines from ERB result.
+ xml.write erb.result(binding).gsub(/^\s*$\n/, '')
end
+ # Remove bad characters from ERB result.
+ `iconv -c -s -f utf8 -t utf8 #{input_xml} > #{output_xml}`
+ FileUtils.rm input_xml
end
if ARGV.include? "--email"