aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-03-04 14:06:25 -0600
committerJack Nagel2014-03-04 14:06:25 -0600
commit4c0db19538d69cc2d00f8455b94c85d75c9a4203 (patch)
tree49547fcc568144c751f1e6492772a0184c62857c /Library
parente8727a4eeea08b21b10e561685c898100e3697b6 (diff)
downloadbrew-4c0db19538d69cc2d00f8455b94c85d75c9a4203.tar.bz2
Extract installer setup to prelude method
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/install.rb1
-rw-r--r--Library/Homebrew/cmd/upgrade.rb1
-rw-r--r--Library/Homebrew/formula_installer.rb11
3 files changed, 9 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index cd3c3c8d2..bd90e9cc3 100644
--- a/Library/Homebrew/cmd/install.rb
+++ b/Library/Homebrew/cmd/install.rb
@@ -104,6 +104,7 @@ module Homebrew extend self
def install_formula f
fi = FormulaInstaller.new(f)
+ fi.prelude
fi.install
fi.caveats
fi.finish
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index 644e61184..02cb85170 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -59,6 +59,7 @@ module Homebrew extend self
installer = FormulaInstaller.new(f)
installer.options |= Tab.for_formula(f).used_options
installer.show_header = false
+ installer.prelude
oh1 "Upgrading #{f.name}"
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index a5487f521..241afa517 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -30,10 +30,6 @@ class FormulaInstaller
@poured_bottle = false
@pour_failed = false
-
- verify_deps_exist unless ignore_deps
- lock
- check_install_sanity
end
def pour_bottle? install_bottle_options={:warn=>false}
@@ -41,6 +37,12 @@ class FormulaInstaller
options.empty? && install_bottle?(f, install_bottle_options)
end
+ def prelude
+ verify_deps_exist unless ignore_deps
+ lock
+ check_install_sanity
+ end
+
def verify_deps_exist
f.recursive_dependencies.map(&:to_formula)
rescue TapFormulaUnavailableError => e
@@ -311,6 +313,7 @@ class FormulaInstaller
fi.ignore_deps = true
fi.only_deps = false
fi.show_header = false
+ fi.prelude
oh1 "Installing #{f} dependency: #{Tty.green}#{dep.name}#{Tty.reset}"
outdated_keg.unlink if outdated_keg
fi.install