From 5c2837c18c50ab6d1afd2250f3ffee73d530edef Mon Sep 17 00:00:00 2001 From: Max Howell Date: Sat, 17 Mar 2012 01:23:53 +0000 Subject: [PATCH] Report correct conflicting tap Fixes: $ brew tap adamv/alt ...blah blah blah.. $ brew tap josegonzalez/php ...blah blah blah... Warning: Could not tap josegonzalez/php/php over mxcl/master/php Where it should be "over adamv/alt/php". --- Library/Homebrew/cmd/tap.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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