install: use Formula#full_name

This commit is contained in:
Xu Cheng 2015-05-27 21:00:09 +08:00
parent 4c323cdf34
commit e8f888a23e

View File

@ -42,35 +42,35 @@ module Homebrew
# head-only without --HEAD is an error
if not ARGV.build_head? and f.stable.nil? and f.devel.nil?
raise <<-EOS.undent
#{f.name} is a head-only formula
Install with `brew install --HEAD #{f.name}`
#{f.full_name} is a head-only formula
Install with `brew install --HEAD #{f.full_name}`
EOS
end
# devel-only without --devel is an error
if not ARGV.build_devel? and f.stable.nil? and f.head.nil?
raise <<-EOS.undent
#{f.name} is a devel-only formula
Install with `brew install --devel #{f.name}`
#{f.full_name} is a devel-only formula
Install with `brew install --devel #{f.full_name}`
EOS
end
if ARGV.build_stable? and f.stable.nil?
raise "#{f.name} has no stable download, please choose --devel or --HEAD"
raise "#{f.full_name} has no stable download, please choose --devel or --HEAD"
end
# --HEAD, fail with no head defined
if ARGV.build_head? and f.head.nil?
raise "No head is defined for #{f.name}"
raise "No head is defined for #{f.full_name}"
end
# --devel, fail with no devel defined
if ARGV.build_devel? and f.devel.nil?
raise "No devel block is defined for #{f.name}"
raise "No devel block is defined for #{f.full_name}"
end
if f.installed?
msg = "#{f.name}-#{f.installed_version} already installed"
msg = "#{f.full_name}-#{f.installed_version} already installed"
msg << ", it's just not linked" unless f.linked_keg.symlink? or f.keg_only?
opoo msg
else