aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/tap.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index f87349977..13d9290e3 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -36,7 +36,9 @@ module Homebrew extend self
if $?.success?
ignores << formula.basename.to_s
else
- opoo "#{formula.basename('.rb')} conflicts"
+ from = Pathname.new("../Taps").join(formula).tap_ref
+ to = HOMEBREW_LIBRARY.join("Formula/#{formula.basename}").tap_ref
+ opoo "Could not tap #{Tty.white}#{from}#{Tty.reset} over #{Tty.white}#{to}#{Tty.reset}"
end
end
end
@@ -56,3 +58,17 @@ module Homebrew extend self
end
end
+
+
+class Pathname
+ def tap_ref
+ case self.realpath.to_s
+ when %r{^#{HOMEBREW_LIBRARY}/Taps/(\w+)-(\w+)/(.+)}
+ "#$1/#$2/#{File.basename($3, '.rb')}"
+ when %r{^#{HOMEBREW_LIBRARY}/Formula/(.+)}
+ "mxcl/master/#{File.basename($1, '.rb')}"
+ else
+ self.basenname('.rb').to_s
+ end
+ end
+end