Make FormulaInstaller setup more readable

This commit is contained in:
Jack Nagel 2014-03-13 10:11:00 -05:00
parent ce5e2aa65c
commit 3b68723fa8
3 changed files with 28 additions and 28 deletions

View File

@ -56,13 +56,13 @@ module Homebrew extend self
def upgrade_formula f def upgrade_formula f
outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil outdated_keg = Keg.new(f.linked_keg.realpath) rescue nil
installer = FormulaInstaller.new(f) fi = FormulaInstaller.new(f)
installer.options |= Tab.for_formula(f).used_options fi.options = Tab.for_formula(f).used_options
installer.build_from_source = ARGV.build_from_source? fi.build_from_source = ARGV.build_from_source?
installer.verbose = ARGV.verbose? fi.verbose = ARGV.verbose?
installer.verbose &&= :quieter if ARGV.quieter? fi.verbose &&= :quieter if ARGV.quieter?
installer.debug = ARGV.debug? fi.debug = ARGV.debug?
installer.prelude fi.prelude
oh1 "Upgrading #{f.name}" oh1 "Upgrading #{f.name}"
@ -71,9 +71,9 @@ module Homebrew extend self
# do! Seriously, it happens! # do! Seriously, it happens!
outdated_keg.unlink if outdated_keg outdated_keg.unlink if outdated_keg
installer.install fi.install
installer.caveats fi.caveats
installer.finish fi.finish
# If the formula was pinned, and we were force-upgrading it, unpin and # If the formula was pinned, and we were force-upgrading it, unpin and
# pin it again to get a symlink pointing to the correct keg. # pin it again to get a symlink pointing to the correct keg.