From 95ce00729cda1ed9aa1cf1041f3c7fdc89731d3e Mon Sep 17 00:00:00 2001 From: Max Howell Date: Thu, 15 Sep 2011 10:57:03 +0100 Subject: [PATCH] Check Cellar can be made before installing stuff Refs Homebrew/homebrew#5188. --- Library/Homebrew/cmd/install.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index ffaf34480a..7142a5fcbd 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -62,11 +62,21 @@ module Homebrew extend self end end + def check_cellar + FileUtils.mkdir_p HOMEBREW_CELLAR if not File.exist? HOMEBREW_CELLAR + rescue + raise <<-EOS.undent + Could not create #{HOMEBREW_CELLAR} + Check you have permission to write to #{HOMEBREW_CELLAR.parent} + EOS + end + def perform_preinstall_checks check_ppc check_writable_install_location check_cc check_macports + check_cellar end def install_formulae formulae