From e01fa7d2aec5d07ec8b8d7cd6d7cb2d0f48ce9c1 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 13 Jan 2021 09:23:36 +0000 Subject: [PATCH] keg: tweak retry comment. --- Library/Homebrew/keg.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 30aca75a1..562c95cee 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -647,13 +647,10 @@ class Keg dst.delete if options[:overwrite] && (dst.exist? || dst.symlink?) dst.make_relative_symlink(src) rescue Errno::EEXIST => e - # We're linking a different version of the same formula - # Note that the AlreadyLinkedError check above *should* - # have caught this, but there are circumstances in which - # we end up with symlinks for a formula even though - # it seems to be missing an optlink. In that case, - # we should be clear to blow those away and replace - # them. + # Retry if we're linking a different version of the same + # formula. The `AlreadyLinkedError` above won't catch + # this if a formula is missing an optlink. In that case, + # delete the symlink and retry. if dst.symlink? && Keg.for(dst).name == name dst.unlink retry