Fix writing build options to install receipt
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
33ec48a394
commit
8952bcf315
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user