Skip to content
Snippets Groups Projects
Commit 44ba4583 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

bottle: improve --keep-old failure output.

If fields have changed: tell the user what they were before and are
afterwards.
parent 4fb691e1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment