Disconnect defined options from the build object
This commit is contained in:
parent
8fc4bba03a
commit
2f1d40a764
@ -1,7 +1,5 @@
|
||||
require 'options'
|
||||
|
||||
# This class holds the build-time options defined for a Formula,
|
||||
# and provides named access to those options during install.
|
||||
class BuildOptions
|
||||
include Enumerable
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
unless f.build.empty?
|
||||
unless f.options.empty?
|
||||
ohai "Options"
|
||||
Homebrew.dump_options_for_formula f
|
||||
end
|
||||
|
||||
@ -14,9 +14,9 @@ module Homebrew
|
||||
|
||||
def puts_options(formulae)
|
||||
formulae.each do |f|
|
||||
next if f.build.empty?
|
||||
next if f.options.empty?
|
||||
if ARGV.include? '--compact'
|
||||
puts f.build.as_flags.sort * " "
|
||||
puts f.options.as_flags.sort * " "
|
||||
else
|
||||
puts f.name if formulae.length > 1
|
||||
dump_options_for_formula f
|
||||
@ -26,7 +26,7 @@ module Homebrew
|
||||
end
|
||||
|
||||
def dump_options_for_formula f
|
||||
f.build.sort_by(&:flag).each do |opt|
|
||||
f.options.sort_by(&:flag).each do |opt|
|
||||
puts "#{opt.flag}\n\t#{opt.description}"
|
||||
end
|
||||
puts "--devel\n\tinstall development version #{f.devel.version}" if f.devel
|
||||
|
||||
@ -101,6 +101,10 @@ class Formula
|
||||
active_spec.patches
|
||||
end
|
||||
|
||||
def options
|
||||
active_spec.options
|
||||
end
|
||||
|
||||
def option_defined?(name)
|
||||
active_spec.option_defined?(name)
|
||||
end
|
||||
@ -440,7 +444,7 @@ class Formula
|
||||
"caveats" => caveats
|
||||
}
|
||||
|
||||
hsh["options"] = build.map { |opt|
|
||||
hsh["options"] = options.map { |opt|
|
||||
{ "option" => opt.flag, "description" => opt.description }
|
||||
}
|
||||
|
||||
|
||||
@ -461,7 +461,7 @@ class FormulaInstaller
|
||||
when f.devel then args << "--devel"
|
||||
end
|
||||
|
||||
f.build.each do |opt, _|
|
||||
f.options.each do |opt, _|
|
||||
name = opt.name[/\A(.+)=\z$/, 1]
|
||||
value = ARGV.value(name)
|
||||
args << "--#{name}=#{value}" if name && value
|
||||
|
||||
@ -71,7 +71,7 @@ class Tab < OpenStruct
|
||||
|
||||
def self.dummy_tab f=nil
|
||||
Tab.new :used_options => [],
|
||||
:unused_options => (f.build.as_flags rescue []),
|
||||
:unused_options => (f.options.as_flags rescue []),
|
||||
:built_as_bottle => false,
|
||||
:poured_from_bottle => false,
|
||||
:tapped_from => "",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user