aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorMisty De Meo2012-10-02 13:21:00 -0500
committerMisty De Meo2012-10-15 09:46:29 -0500
commitbbfb6400c77aeaaf88216263d86491d85a40f8a9 (patch)
tree2d07e2d07653ed7d3010b2a0ca6b8019adf7a3e1 /Library/Homebrew/formula.rb
parent3fb5dfbd7b77e03ccd9b8aee54c198673a9cb054 (diff)
downloadbrew-bbfb6400c77aeaaf88216263d86491d85a40f8a9.tar.bz2
Manage Requirements using ComparableSet
ComparableSet only allows a single object of a given class, choosing the object with the greatest value. This was mainly created for Requirements, so that, e.g., two X11Dependencies of differing strictness don't both end up in the same requirement set. Fixes Homebrew/homebrew#15240.
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index d23aeea71..8f63cd705 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -6,6 +6,7 @@ require 'bottles'
require 'patches'
require 'compilers'
require 'build_environment'
+require 'extend/set'
class Formula
@@ -455,9 +456,9 @@ class Formula
end
def recursive_requirements
- reqs = recursive_deps.map { |dep| dep.requirements }.to_set
- reqs << requirements
- reqs.flatten
+ reqs = ComparableSet.new
+ recursive_deps.each { |dep| reqs.merge dep.requirements }
+ reqs.merge requirements
end
def to_hash