install: fix if isn't migrated

This commit is contained in:
Vlad Shablinsky 2015-08-25 15:38:25 +02:00 committed by Mike McQuaid
parent 59bd08e992
commit b68562d941

View File

@ -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