link: load formula from rack

This commit is contained in:
Xu Cheng 2015-05-17 20:35:32 +08:00
parent c14794baa8
commit fb8548cae5

View File

@ -14,7 +14,7 @@ module Homebrew
opoo "Already linked: #{keg}" opoo "Already linked: #{keg}"
puts "To relink: brew unlink #{keg.name} && brew link #{keg.name}" puts "To relink: brew unlink #{keg.name} && brew link #{keg.name}"
next next
elsif keg_only?(keg.name) && !ARGV.force? elsif keg_only?(keg.rack) && !ARGV.force?
opoo "#{keg.name} is keg-only and must be linked with --force" opoo "#{keg.name} is keg-only and must be linked with --force"
puts "Note that doing so can interfere with building software." puts "Note that doing so can interfere with building software."
next next
@ -48,9 +48,9 @@ module Homebrew
private private
def keg_only?(name) def keg_only?(rack)
Formulary.factory(name).keg_only? Formulary.from_rack(rack).keg_only?
rescue FormulaUnavailableError rescue FormulaUnavailableError, TapFormulaAmbiguityError
false false
end end
end end