Wrap cellar compatibility check in a method

This commit is contained in:
Jack Nagel 2014-03-10 14:56:02 -05:00
parent 4b80d30bab
commit 32ab18c189
2 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,7 @@ def install_bottle? f, options={:warn=>false}
return false unless f.pour_bottle? return false unless f.pour_bottle?
return false unless f.bottle return false unless f.bottle
if f.bottle.cellar != :any && f.bottle.cellar != HOMEBREW_CELLAR.to_s unless f.bottle.compatible_cellar?
if options[:warn] if options[:warn]
opoo "Building source; cellar of #{f}'s bottle is #{f.bottle.cellar}" opoo "Building source; cellar of #{f}'s bottle is #{f.bottle.cellar}"
end end

View File

@ -121,6 +121,10 @@ class Bottle
@cellar = spec.cellar @cellar = spec.cellar
@revision = spec.revision @revision = spec.revision
end end
def compatible_cellar?
cellar == :any || cellar == HOMEBREW_CELLAR.to_s
end
end end
class BottleSpecification class BottleSpecification