aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-08-10 21:45:24 -0500
committerJack Nagel2014-08-10 21:45:24 -0500
commit2f1d40a76437f94720c9969d11ff10555efc5809 (patch)
tree95f95f79490e79c1758d90277c2cb91b72be7c23
parent8fc4bba03a1b3d0446ed52c0c294c59b28be0cf9 (diff)
downloadbrew-2f1d40a76437f94720c9969d11ff10555efc5809.tar.bz2
Disconnect defined options from the build object
-rw-r--r--Library/Homebrew/build_options.rb2
-rw-r--r--Library/Homebrew/cmd/info.rb2
-rw-r--r--Library/Homebrew/cmd/options.rb6
-rw-r--r--Library/Homebrew/formula.rb6
-rw-r--r--Library/Homebrew/formula_installer.rb2
-rw-r--r--Library/Homebrew/tab.rb2
6 files changed, 11 insertions, 9 deletions
diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb
index b04c9dc1d..a50aa21c1 100644
--- a/Library/Homebrew/build_options.rb
+++ b/Library/Homebrew/build_options.rb
@@ -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
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index 1ce1966e1..fd08845c4 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -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
diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb
index fcc149adf..ba03abb66 100644
--- a/Library/Homebrew/cmd/options.rb
+++ b/Library/Homebrew/cmd/options.rb
@@ -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
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 13624537c..f571b69dd 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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 }
}
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 45c70e6ce..3c7dec8e5 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -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
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index 5dedc4d3c..edba1d0e6 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -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 => "",