diff options
| author | Mike McQuaid | 2017-01-09 21:42:09 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2017-01-09 21:42:09 +0000 |
| commit | d8adae0f92fcf6685d8fc8a1a44e6a11db30fac0 (patch) | |
| tree | ab015b1eb3bb1e5698828c852a35565690529d91 /Library/Homebrew | |
| parent | 9cce3414fbd39d146d97911dbb3bf07fffaa1080 (diff) | |
| download | brew-d8adae0f92fcf6685d8fc8a1a44e6a11db30fac0.tar.bz2 | |
formulary: read from formula in opt prefix.
We want to prefer the newer/versioned formulae when possible but this
is preferable to a random cached formula or, worse, no formula.
This means `brew info foo` will never complain that `foo` is a missing
formula.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formulary.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index fadd89457..25df57cdc 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -380,6 +380,11 @@ class Formulary return TapLoader.new(possible_tap_newname_formulae.first, from: from) end + possible_keg_formula = Pathname.new("#{HOMEBREW_PREFIX}/opt/#{ref}/.brew/#{ref}.rb") + if possible_keg_formula.file? + return FormulaLoader.new(ref, possible_keg_formula) + end + possible_cached_formula = Pathname.new("#{HOMEBREW_CACHE_FORMULA}/#{ref}.rb") if possible_cached_formula.file? return FormulaLoader.new(ref, possible_cached_formula) |
