bottle: allow updating :any to :any_skip_relocation when keep old

Closes Homebrew/homebrew#43849.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-09-12 16:33:11 +08:00
parent ed87972e2d
commit 635340e32e

View File

@ -235,6 +235,7 @@ module Homebrew
bad_fields = [:root_url, :prefix, :cellar, :revision].select do |field|
old_spec.send(field) != bottle.send(field)
end
bad_fields.delete(:cellar) if old_spec.cellar == :any && bottle.cellar == :any_skip_relocation
if bad_fields.any?
bottle_path.unlink if bottle_path.exist?
odie "--keep-old is passed but there are changes in: #{bad_fields.join ", "}"
@ -289,7 +290,7 @@ module Homebrew
bad_fields = [:root_url, :prefix, :cellar, :revision].select do |field|
old_spec.send(field) != bottle.send(field)
end
bad_fields.delete(:cellar) if old_spec.cellar == :any && bottle.cellar == :any_skip_relocation
if bad_fields.any?
ofail "--keep-old is passed but there are changes in: #{bad_fields.join ", "}"
next