aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-10-20 17:07:53 -0500
committerJack Nagel2014-10-20 17:07:53 -0500
commit257b0e43ec207ad201a6f50ea9c63a5f0bd7f58d (patch)
treea90862064a536254c66fda509f39d227ad7d6dac /Library
parent449f2fc51aedb561f91507c0e82d903708228657 (diff)
downloadhomebrew-257b0e43ec207ad201a6f50ea9c63a5f0bd7f58d.tar.bz2
Return early from resolve_any_conflicts for non-symlinks
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index c826598e8..0a7d9ae2c 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -325,12 +325,14 @@ class Keg
private
def resolve_any_conflicts dst, mode
+ return unless dst.symlink?
+
src = dst.resolved_path
# src itself may be a symlink, so check lstat to ensure we are dealing with
# a directory, and not a symlink pointing at a directory (which needs to be
# treated as a file). In other words, we only want to resolve one symlink.
# If it isn't a directory, make_relative_symlink will raise an exception.
- if dst.symlink? && src.lstat.directory?
+ if src.lstat.directory?
keg = Keg.for(src)
dst.unlink unless mode.dry_run
keg.link_dir(src, mode) { :mkpath }