install: tweak missing formula behaviour.

- Run `brew search` for local formulae first (as it's quickest) rather
  than checking Git history.
- Don't output `Searching taps...` because `Searching taps on GitHub...`
  is output by the called function (and because it'll say it's searching
  taps even when it is not if `HOMEBREW_NO_GITHUB_API` is set).
This commit is contained in:
Mike McQuaid 2020-10-26 11:48:06 +00:00
parent 60046ac41c
commit f099256fef
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -304,12 +304,6 @@ module Homebrew
return return
end end
ofail e.message
if (reason = MissingFormula.reason(e.name))
$stderr.puts reason
return
end
ohai "Searching for similarly named formulae..." ohai "Searching for similarly named formulae..."
formulae_search_results = search_formulae(e.name) formulae_search_results = search_formulae(e.name)
case formulae_search_results.length case formulae_search_results.length
@ -325,10 +319,15 @@ module Homebrew
puts "To install one of them, run (for example):\n brew install #{formulae_search_results.first}" puts "To install one of them, run (for example):\n brew install #{formulae_search_results.first}"
end end
ofail e.message
if (reason = MissingFormula.reason(e.name))
$stderr.puts reason
return
end
# Do not search taps if the formula name is qualified # Do not search taps if the formula name is qualified
return if e.name.include?("/") return if e.name.include?("/")
ohai "Searching taps..."
taps_search_results = search_taps(e.name)[:formulae] taps_search_results = search_taps(e.name)[:formulae]
case taps_search_results.length case taps_search_results.length
when 0 when 0