diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index dcf3089523..bef0dfb5b7 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -30,11 +30,11 @@ module Homebrew extend self cd HOMEBREW_LIBRARY/"Formula" do formulae.each do |formula| - from = HOMEBREW_LIBRARY.join("Taps/#{formula}").tap_ref - to = HOMEBREW_LIBRARY.join("Formula/#{formula.basename}").tap_ref + from = HOMEBREW_LIBRARY.join("Taps/#{formula}") + to = HOMEBREW_LIBRARY.join("Formula/#{formula.basename}") # Unexpected, but possible, lets proceed as if nothing happened - formula.delete if from == to + formula.delete if to.symlink? and to.realpath == from # using the system ln is the only way to get relative symlinks system "ln -s ../Taps/#{formula} 2>/dev/null" @@ -42,7 +42,8 @@ module Homebrew extend self ignores << formula.basename.to_s tapped += 1 else - opoo "Could not tap #{Tty.white}#{from}#{Tty.reset} over #{Tty.white}#{to}#{Tty.reset}" + to = to.realpath if to.exist? + opoo "Could not tap #{Tty.white}#{from.tap_ref}#{Tty.reset} over #{Tty.white}#{to.tap_ref}#{Tty.reset}" end end end