diff options
| author | Xu Cheng | 2015-03-11 16:36:36 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-03-11 17:27:49 +0800 |
| commit | ddb1b5ae254577685927c7569371f48da5aeeb2c (patch) | |
| tree | d43b89b6ade158cd319c96e3fbde70368fabce68 | |
| parent | 3b672f1b26805084a9742efde3db99d419e04a51 (diff) | |
| download | homebrew-ddb1b5ae254577685927c7569371f48da5aeeb2c.tar.bz2 | |
install: refactoring blacklist check
Closes #37590.
Signed-off-by: Xu Cheng <xucheng@me.com>
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 69c1fe7fa..53afc766b 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -14,11 +14,6 @@ module Homebrew end ARGV.named.each do |name| - # if a formula has been tapped ignore the blacklisting - unless Formula.path(name).file? - msg = blacklisted? name - raise "No available formula for #{name}\n#{msg}" if msg - end if !File.exist?(name) && (name =~ HOMEBREW_TAP_FORMULA_REGEX \ || name =~ HOMEBREW_CASK_TAP_FORMULA_REGEX) install_tap $1, $2 @@ -87,12 +82,16 @@ module Homebrew formulae.each { |f| install_formula(f) } rescue FormulaUnavailableError => e - ofail e.message - query = query_regexp(e.name) - puts 'Searching formulae...' - puts_columns(search_formulae(query)) - puts 'Searching taps...' - puts_columns(search_taps(query)) + if (blacklist = blacklisted?(e.name)) + ofail "#{e.message}\n#{blacklist}" + else + ofail e.message + query = query_regexp(e.name) + puts "Searching formulae..." + puts_columns(search_formulae(query)) + puts "Searching taps..." + puts_columns(search_taps(query)) + end end end |
