aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorMike McQuaid2016-09-10 10:13:33 +0100
committerMike McQuaid2016-09-10 10:13:33 +0100
commit44ba4583b74f913658d246ed74de204c70757806 (patch)
tree239e8952a19da4cc594c002fb069212d8ef94b42 /Library/Homebrew/dev-cmd
parent4fb691e1759eab70801d58801ed28762e4519897 (diff)
downloadbrew-44ba4583b74f913658d246ed74de204c70757806.tar.bz2
bottle: improve --keep-old failure output.
If fields have changed: tell the user what they were before and are afterwards.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/bottle.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb
index 1ae44b7e6..306296b46 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