aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Shablinsky2015-08-25 15:38:25 +0200
committerMike McQuaid2015-08-27 13:51:04 +0100
commitb68562d941730035f1f2a7769d462fb5aef4b852 (patch)
tree60b93847a16c91eeb70509aa6434107bbd6720d5
parent59bd08e9927f35e1de5e1ae67b1394884213fde1 (diff)
downloadbrew-b68562d941730035f1f2a7769d462fb5aef4b852.tar.bz2
install: fix if isn't migrated
-rw-r--r--Library/Homebrew/cmd/install.rb15
1 files changed, 8 insertions, 7 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb
index 47735a23c..f39ebbd2a 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