diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index edf82a71de..ab8a453009 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -213,15 +213,15 @@ class Keg < Pathname protected - def resolve_any_conflicts dst + def resolve_any_conflicts dst, mode # if it isn't a directory then a severe conflict is about to happen. Let # it, and the exception that is generated will message to the user about # the situation if dst.symlink? and dst.directory? src = (dst.parent+dst.readlink).cleanpath keg = Keg.for(src) - dst.unlink - keg.link_dir(src) { :mkpath } + dst.unlink unless mode.dry_run + keg.link_dir(src, mode) { :mkpath } return true end rescue NotAKegError @@ -301,9 +301,9 @@ class Keg < Pathname when :skip_dir Find.prune when :mkpath - dst.mkpath unless resolve_any_conflicts(dst) + dst.mkpath unless resolve_any_conflicts(dst, mode) else - unless resolve_any_conflicts(dst) + unless resolve_any_conflicts(dst, mode) make_relative_symlink dst, src, mode Find.prune end