aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorXu Cheng2016-07-15 15:03:58 +0800
committerXu Cheng2016-07-15 19:57:23 +0800
commit7452dcf5081d727eb163944d74ceda0d69f84332 (patch)
treefdf5c3bf5c5d08deeed541ff0db80a4b3da2a4b5 /Library/Homebrew
parent2e747aa910ccfd645388a52517f285047a3276fe (diff)
downloadbrew-7452dcf5081d727eb163944d74ceda0d69f84332.tar.bz2
ARGV#resolved_formulae: also load build options
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/extend/ARGV.rb8
-rw-r--r--Library/Homebrew/formulary.rb4
2 files changed, 8 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index 8f783aea1..f37c550c8 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -27,9 +27,11 @@ module HomebrewArgvExtension
@resolved_formulae ||= (downcased_unique_named - casks).map do |name|
if name.include?("/")
f = Formulary.factory(name, spec)
- if spec(default=nil).nil? && f.any_version_installed?
- installed_spec = Tab.for_formula(f).spec
- f.set_active_spec(installed_spec) if f.send(installed_spec)
+ if f.any_version_installed?
+ tab = Tab.for_formula(f)
+ resolved_spec = spec(default=nil) || tab.spec
+ f.set_active_spec(resolved_spec) if f.send(resolved_spec)
+ f.build = tab
end
f
else
diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb
index 38f71c85a..c53262db9 100644
--- a/Library/Homebrew/formulary.rb
+++ b/Library/Homebrew/formulary.rb
@@ -227,7 +227,7 @@ class Formulary
tap = tab.tap
spec ||= tab.spec
- if tap.nil?
+ f = if tap.nil?
factory(rack.basename.to_s, spec)
else
begin
@@ -237,6 +237,8 @@ class Formulary
factory(rack.basename.to_s, spec)
end
end
+ f.build = tab
+ f
end
# Return a Formula instance directly from contents