From 950512ad3426b3f21d624de6741afbd2dbabbdd2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 13 Dec 2016 00:19:46 +0000 Subject: [PATCH] diagnostic: check for multiple Cellars. And tell people to delete the HOMEBREW_REPOSITORY one. The HOMEBREW_PREFIX one is preferable for bottling. --- Library/Homebrew/diagnostic.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index e8506ce807..81404c6252 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -404,6 +404,18 @@ module Homebrew EOS end + def check_multiple_cellars + return if HOMEBREW_PREFIX.to_s == HOMEBREW_REPOSITORY.to_s + return unless (HOMEBREW_REPOSITORY/"Cellar").exist? + return unless (HOMEBREW_PREFIX/"Cellar").exist? + + <<-EOS.undent + You have multiple Cellars. + You should delete #{HOMEBREW_REPOSITORY}/Cellar: + rm -rf #{HOMEBREW_REPOSITORY}/Cellar + EOS + end + def check_homebrew_prefix return if HOMEBREW_PREFIX.to_s == "/usr/local"