diff options
| author | Xu Cheng | 2015-06-12 13:26:46 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-06-12 16:20:44 +0800 |
| commit | c1fb7a8e4ab896c73b95351b215b123c50e407f6 (patch) | |
| tree | c1a37d7dc42142c39bf8dd81a65253a3d77e1dae /Library | |
| parent | 9c3a6a3f52317808a0fb2dfd5a1e802128cadd57 (diff) | |
| download | brew-c1fb7a8e4ab896c73b95351b215b123c50e407f6.tar.bz2 | |
tap_paths: prevent conflicted formulae happen in the same tap
Closes Homebrew/homebrew#40606.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formulary.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index cc59b3472..72024642c 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -244,8 +244,11 @@ class Formulary def self.tap_paths(name) name = name.downcase Dir["#{HOMEBREW_LIBRARY}/Taps/*/*/"].map do |tap| - Pathname.glob(["#{tap}#{name}.rb", "#{tap}Formula/#{name}.rb", - "#{tap}HomebrewFormula/#{name}.rb"]) - end.flatten.select(&:file?) + Pathname.glob([ + "#{tap}Formula/#{name}.rb", + "#{tap}HomebrewFormula/#{name}.rb", + "#{tap}#{name}.rb", + ]).detect(&:file?) + end.compact end end |
