ARGV#resolved_formulae: also load build options

This commit is contained in:
Xu Cheng 2016-07-15 15:03:58 +08:00
parent 2e747aa910
commit 7452dcf508
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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