Add pour_bottle? method to Formula.

Allows a formula to selectively disable bottle pouring.
e.g. the default Boost bottle does not work with a brewed Python.

Fixes Homebrew/homebrew#17142
This commit is contained in:
Mike McQuaid 2013-01-27 19:22:56 +00:00
parent b58077b3e8
commit 599b012702
2 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,7 @@ def install_bottle? f
and f.downloader.local_bottle_path
not ARGV.build_from_source? \
and MacOS.bottles_supported? \
and f.pour_bottle? \
and f.build.used_options.empty? \
and bottle_current?(f)
end

View File

@ -162,6 +162,13 @@ class Formula
@downloader.cached_location
end
# Can be overridden to selectively disable bottles from formulae.
# Defaults to true so overridden version does not have to check if bottles
# are supported.
def pour_bottle?
true
end
# tell the user about any caveats regarding this package, return a string
def caveats; nil end