diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index b6ec3b4854..569ea79881 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -62,7 +62,8 @@ class SoftwareSpec end def bottled? - bottle_specification.tag?(bottle_tag) + bottle_specification.tag?(bottle_tag) && \ + bottle_specification.compatible_cellar? end def bottle &block @@ -220,6 +221,7 @@ class Bottle @name = formula.name @resource = Resource.new @resource.owner = formula + @spec = spec checksum, tag = spec.checksum_for(bottle_tag) @@ -234,7 +236,7 @@ class Bottle end def compatible_cellar? - cellar == :any || cellar == HOMEBREW_CELLAR.to_s + @spec.compatible_cellar? end def stage @@ -265,6 +267,10 @@ class BottleSpecification @collector = BottleCollector.new end + def compatible_cellar? + cellar == :any || cellar == HOMEBREW_CELLAR.to_s + end + def tag?(tag) !!checksum_for(tag) end