diff options
| author | Jack Nagel | 2012-08-12 13:37:40 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-08-12 13:37:40 -0500 |
| commit | 8952bcf315e19c60966b483fef80a69d31ca2c1e (patch) | |
| tree | 851e7038fe5e45f77291dc5c8177f3b6950c8414 /Library | |
| parent | 33ec48a3946c78c392d71a2b631414710f8beb8b (diff) | |
| download | brew-8952bcf315e19c60966b483fef80a69d31ca2c1e.tar.bz2 | |
Fix writing build options to install receipt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula_support.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/tab.rb | 4 |
2 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/formula_support.rb b/Library/Homebrew/formula_support.rb index 4c2a5e8ec..c0b920b2c 100644 --- a/Library/Homebrew/formula_support.rb +++ b/Library/Homebrew/formula_support.rb @@ -156,6 +156,7 @@ end # This class holds the build-time options defined for a Formula, # and provides named access to those options during install. class BuildOptions + include Enumerable def initialize args # Take a copy of the args (any string array, actually) @@ -181,19 +182,15 @@ class BuildOptions end def has_option? name - @options.any? {|o| o[0] == name} + @options.any? { |opt, _| opt == name } end def empty? @options.empty? end - def collect - @options.collect {|o| yield o[0], o[1]} - end - def each - @options.each {|o| yield o[0], o[1]} + @options.each { |opt, desc| yield opt, desc } end def include? name diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 78e1bdab5..0d93c46ae 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -13,7 +13,7 @@ class Tab < OpenStruct arg_options = args.options_only # Pick off the option flags from the formula's `options` array by # discarding the descriptions. - formula_options = f.options.map { |o, _| o } + formula_options = f.build.map { |opt, _| "--#{opt}" } Tab.new :used_options => formula_options & arg_options, :unused_options => formula_options - arg_options, @@ -67,7 +67,7 @@ class Tab < OpenStruct def self.dummy_tab f Tab.new :used_options => [], - :unused_options => f.options.map { |o, _| o}, + :unused_options => f.build.map { |opt, _| "--#{opt}" }, :built_bottle => false, :tapped_from => "" end |
