From 0d76dfadcc11a2131917a4a677cc82bc16710b7c Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 19 Sep 2016 20:16:35 +0100 Subject: [PATCH] utils: fix completions/manpages/docs linking. --- Library/Homebrew/utils.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 8121b71465..e466f8a08d 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -605,8 +605,11 @@ def link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) src_paths = link_dir ? [src_dir] : src_dir.find src_paths.each do |src| next if src.directory? && !link_dir - dst = dst_dir.parent/src.relative_path_from(src_dir.parent) - next if dst.symlink? && src == dst.resolved_path + dst = dst_dir/src.relative_path_from(src_dir) + if dst.symlink? + next if src == dst.resolved_path + dst.unlink + end if dst.exist? conflicts << dst next