aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMax Howell2012-03-19 12:24:13 +0000
committerMax Howell2012-03-19 12:24:13 +0000
commit88118b51b263ff32a0c18dc59e72b9b5ff265a28 (patch)
treebcc1b7ddd5dc3bbfea008d5628efd350077a937e /Library/Homebrew/cmd
parentc3370c48ce3ec6d00387e427413e46ca65d585d8 (diff)
downloadbrew-88118b51b263ff32a0c18dc59e72b9b5ff265a28.tar.bz2
Don't error if exact link already exists
If the link already exists exactly (well almost exactly) as we are about to correct it, then it's okay. Otherwise we error out. This is a safe choice, and really, the correct choice too. This will prevent the tickets like Homebrew/homebrew#11050 from occurring.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/link.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb
index 09d16c782..8885d0155 100644
--- a/Library/Homebrew/cmd/link.rb
+++ b/Library/Homebrew/cmd/link.rb
@@ -10,6 +10,11 @@ module Homebrew extend self
end
ARGV.kegs.each do |keg|
+ if keg.linked_keg_record.directory? and keg.linked_keg_record.realpath == keg
+ opoo "Already linked: #{keg}"
+ next
+ end
+
print "Linking #{keg}... " do
puts if ARGV.verbose?
puts "#{keg.link} symlinks created"