remove unnecessary Tab.for_formula

We already loaded tab in ARGV.resolved_formulae or Formulary.from_rack
This commit is contained in:
Xu Cheng 2016-07-17 18:18:41 +08:00
parent e008f6e53c
commit 820b6347b8
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE
3 changed files with 5 additions and 8 deletions

View File

@ -12,11 +12,10 @@ module Homebrew
installed.each do |f|
deps = []
tab = Tab.for_formula(f)
f.deps.each do |dep|
if dep.optional? || dep.recommended?
deps << dep.to_formula.full_name if tab.with?(dep)
deps << dep.to_formula.full_name if f.build.with?(dep)
else
deps << dep.to_formula.full_name
end

View File

@ -11,8 +11,7 @@ module Homebrew
end
def reinstall_formula(f)
tab = Tab.for_formula(f)
options = tab.used_options | f.build.used_options
options = f.build.used_options
notice = "Reinstalling #{f.full_name}"
notice += " with #{options * ", "}" unless options.empty?
@ -25,7 +24,7 @@ module Homebrew
fi = FormulaInstaller.new(f)
fi.options = options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?)
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?)
fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source?
fi.force_bottle = ARGV.force_bottle?
fi.interactive = ARGV.interactive?

View File

@ -66,11 +66,10 @@ module Homebrew
def upgrade_formula(f)
outdated_keg = Keg.new(f.linked_keg.resolved_path) if f.linked_keg.directory?
tab = Tab.for_formula(f)
fi = FormulaInstaller.new(f)
fi.options = tab.used_options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && tab.build_bottle?)
fi.options = f.build.used_options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?)
fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source?
fi.verbose = ARGV.verbose?
fi.quieter = ARGV.quieter?