From 44ba4583b74f913658d246ed74de204c70757806 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 10 Sep 2016 10:13:33 +0100 Subject: [PATCH] bottle: improve --keep-old failure output. If fields have changed: tell the user what they were before and are afterwards. --- Library/Homebrew/dev-cmd/bottle.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 1ae44b7e67..306296b46f 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -295,7 +295,17 @@ module Homebrew bad_fields.delete(:cellar) if old_spec.cellar == :any && bottle.cellar == :any_skip_relocation unless bad_fields.empty? bottle_path.unlink if bottle_path.exist? - odie "--keep-old is passed but there are changes in: #{bad_fields.join ", "}" + + bad_changes = bad_fields.map do |field| + old_value = old_spec.send(field).inspect + bottle_value = bottle.send(field).inspect + "#{field}: old: #{old_value}, new: #{bottle_value}" + end + + odie <<-EOS.undent + --keep-old was passed but there are changes in: + #{bad_changes.join("\n")} + EOS end end