From 19e387d92e2741fa23cc6fde4743b1b8b28e0fa3 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 23 Aug 2011 23:30:52 +0100 Subject: `brew upgrade` Consequence: you can no longer install when something is already installed, you must upgrade it. This doesn't apply if the formula in question was unlinked. You can still --force installs though. Rationale: the old way of installing over the top would leave symlinks to multiple versions in /usr/local if the old version had a file the newer version didn't. The new upgrade command handles everything properly. --- Library/Homebrew/cmd/install.rb | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'Library/Homebrew/cmd/install.rb') diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index b7f9e7cae..4b2711994 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -57,22 +57,26 @@ module Homebrew extend self end end - def install_formulae formulae - formulae = [formulae].flatten.compact - return if formulae.empty? - + def perform_preinstall_checks check_ppc check_writable_install_location check_cc check_macports + end - formulae.each do |f| - begin - installer = FormulaInstaller.new f - installer.ignore_deps = ARGV.include? '--ignore-dependencies' - installer.go - rescue FormulaAlreadyInstalledError => e - opoo e.message + def install_formulae formulae + formulae = [formulae].flatten.compact + unless formulae.empty? + perform_preinstall_checks + formulae.each do |f| + begin + fi = FormulaInstaller.new(f) + fi.install + fi.caveats + fi.finish + rescue FormulaAlreadyInstalledError => e + opoo e.message + end end end end -- cgit v1.2.3