Require --force to link keg-only.

Closes Homebrew/homebrew#13349.
This commit is contained in:
Adam Vandenberg 2013-01-29 20:31:33 -08:00
parent 8ccda70344
commit 40c339e349

View File

@ -35,6 +35,13 @@ module Homebrew extend self
next
end
f = Formula.factory(keg.fname)
if f.keg_only? and not ARGV.force?
opoo "#{keg.fname} is keg-only and must be linked with --force"
puts "Note that doing so can interfere with building software."
next
end
keg.lock do
print "Linking #{keg}... " do
puts "#{keg.link(mode)} symlinks created"