Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Extract "brew_install".

This was supposed to go in with the "brew-upgrade" external command,
but must have been lost in the merge.
  • Loading branch information...
commit 9670e0ebcc54ea7fb4034663e12c8b169d6be650 1 parent be4732a
@adamv adamv authored
Showing with 46 additions and 43 deletions.
  1. +45 −0 Library/Homebrew/brew.h.rb
  2. +1 −43 bin/brew
View
45 Library/Homebrew/brew.h.rb
@@ -418,6 +418,51 @@ def search_brews text
end
end
+def brew_install
+ require 'formula_installer'
+ require 'hardware'
+
+ ############################################################ sanity checks
+ case Hardware.cpu_type when :ppc, :dunno
+ abort "Sorry, Homebrew does not support your computer's CPU architecture.\n"+
+ "For PPC support, see: http://github.com/sceaga/homebrew/tree/powerpc"
+ end
+
+ raise "Cannot write to #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.exist? and not HOMEBREW_CELLAR.writable?
+ raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
+
+ ################################################################# warnings
+ begin
+ if MACOS_VERSION >= 10.6
+ opoo "You should upgrade to Xcode 3.2.1" if llvm_build < RECOMMENDED_LLVM
+ else
+ opoo "You should upgrade to Xcode 3.1.4" if (gcc_40_build < RECOMMENDED_GCC_40) or (gcc_42_build < RECOMMENDED_GCC_42)
+ end
+ rescue
+ # the reason we don't abort is some formula don't require Xcode
+ # TODO allow formula to declare themselves as "not needing Xcode"
+ opoo "Xcode is not installed! Builds may fail!"
+ end
+
+ if macports_or_fink_installed?
+ opoo "It appears you have Macports or Fink installed"
+ puts "Although, unlikely, this can break builds or cause obscure runtime issues."
+ puts "If you experience problems try uninstalling these tools."
+ end
+
+ ################################################################# install!
+ installer = FormulaInstaller.new
+ installer.install_deps = !ARGV.include?('--ignore-dependencies')
+
+ ARGV.formulae.each do |f|
+ if not f.installed? or ARGV.force?
+ installer.install f
+ else
+ puts "Formula already installed: #{f.prefix}"
+ end
+ end
+end
+
########################################################## class PrettyListing
class PrettyListing
def initialize path
View
44 bin/brew
@@ -259,49 +259,7 @@ begin
when 'install'
check_for_blacklisted_formula(ARGV.named)
-
- require 'formula_installer'
- require 'hardware'
-
- ############################################################ sanity checks
- case Hardware.cpu_type when :ppc, :dunno
- abort "Sorry, Homebrew does not support your computer's CPU architecture.\n"+
- "For PPC support, see: http://github.com/sceaga/homebrew/tree/powerpc"
- end
-
- raise "Cannot write to #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.exist? and not HOMEBREW_CELLAR.writable?
- raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable?
-
- ################################################################# warnings
- begin
- if MACOS_VERSION >= 10.6
- opoo "You should upgrade to Xcode 3.2.1" if llvm_build < RECOMMENDED_LLVM
- else
- opoo "You should upgrade to Xcode 3.1.4" if (gcc_40_build < RECOMMENDED_GCC_40) or (gcc_42_build < RECOMMENDED_GCC_42)
- end
- rescue
- # the reason we don't abort is some formula don't require Xcode
- # TODO allow formula to declare themselves as "not needing Xcode"
- opoo "Xcode is not installed! Builds may fail!"
- end
-
- if macports_or_fink_installed?
- opoo "It appears you have Macports or Fink installed"
- puts "Although, unlikely, this can break builds or cause obscure runtime issues."
- puts "If you experience problems try uninstalling these tools."
- end
-
- ################################################################# install!
- installer = FormulaInstaller.new
- installer.install_deps = !ARGV.include?('--ignore-dependencies')
-
- ARGV.formulae.each do |f|
- if not f.installed? or ARGV.force?
- installer.install f
- else
- puts "Formula already installed: #{f.prefix}"
- end
- end
+ brew_install
when 'log'
Dir.chdir HOMEBREW_REPOSITORY
Please sign in to comment.
Something went wrong with that request. Please try again.