From b68562d941730035f1f2a7769d462fb5aef4b852 Mon Sep 17 00:00:00 2001 From: Vlad Shablinsky Date: Tue, 25 Aug 2015 15:38:25 +0200 Subject: [PATCH] install: fix if isn't migrated --- Library/Homebrew/cmd/install.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 47735a23c1..f39ebbd2a8 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -75,14 +75,15 @@ module Homebrew if f.installed? msg = "#{f.full_name}-#{f.installed_version} already installed" - unless f.linked_keg.symlink? - if f.oldname && (HOMEBREW_CELLAR/f.oldname).exist? - msg << ", it's just not migrated" - elsif !f.keg_only? - msg << ", it's just not linked" - end - end + msg << ", it's just not linked" unless f.linked_keg.symlink? || f.keg_only? opoo msg + elsif f.oldname && (dir = HOMEBREW_CELLAR/f.oldname).exist? && !dir.subdirs.empty? \ + && f.tap == Tab.for_keg(dir.subdirs.first).tap && !ARGV.force? + # Check if the formula we try to install is the same as installed + # but not migrated one. If --force passed then install anyway. + opoo "#{f.oldname} already installed, it's just not migrated" + puts "You can migrate formula with `brew migrate #{f}`" + puts "Or you can force install it with `brew install #{f} --force`" else formulae << f end