tap_paths: prevent conflicted formulae happen in the same tap

Closes Homebrew/homebrew#40606.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-06-12 13:26:46 +08:00
parent 9c3a6a3f52
commit c1fb7a8e4a

View File

@ -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