aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2013-01-29 20:31:33 -0800
committerAdam Vandenberg2013-01-29 20:31:33 -0800
commitdd5ea24d48f1e72cd068a740a8a972cfb5fe1605 (patch)
treea2fb721ba563dba0b7dab76883cf1f4427d3691d /Library
parent5648ae5be3139908f2a4f91a41d5dbdc1f069bbe (diff)
downloadhomebrew-dd5ea24d48f1e72cd068a740a8a972cfb5fe1605.tar.bz2
Require --force to link keg-only.
Closes #13349.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/link.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb
index 6371c41de..76a3b00f0 100644
--- a/Library/Homebrew/cmd/link.rb
+++ b/Library/Homebrew/cmd/link.rb
@@ -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"