install: don't install alias if already installed

This commit is contained in:
Alyssa Ross 2016-09-15 16:01:59 +01:00
parent 2a683f2569
commit c874b4e4c2

View File

@ -133,9 +133,14 @@ module Homebrew
raise "No devel block is defined for #{f.full_name}"
end
if f.installed?
msg = "#{f.full_name}-#{f.installed_version} already installed"
msg << ", it's just not linked" unless f.linked_keg.symlink? || f.keg_only?
current = f if f.installed?
current ||= f.old_installed_formulae.first
if current
msg = "#{current.full_name}-#{current.installed_version} already installed"
unless current.linked_keg.symlink? || current.keg_only?
msg << ", it's just not linked"
end
opoo msg
elsif f.migration_needed? && !ARGV.force?
# Check if the formula we try to install is the same as installed