From 599b012702127b821826d3e9f5c5f5521b82fd16 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 27 Jan 2013 19:22:56 +0000 Subject: [PATCH] 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 --- Library/Homebrew/bottles.rb | 1 + Library/Homebrew/formula.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Library/Homebrew/bottles.rb b/Library/Homebrew/bottles.rb index 2be2e12d7b..88cfc58309 100644 --- a/Library/Homebrew/bottles.rb +++ b/Library/Homebrew/bottles.rb @@ -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 diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index cc16820ef9..37f394ce90 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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