aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-03-16 12:49:09 +0000
committerMax Howell2012-03-16 21:06:17 +0000
commit2ace9422bc4c19be2d6a77e21e66c6dbd4c6bd52 (patch)
treeec583eb46b82fdaceb259d6c8df9d1e219416d95 /Library
parent598f7b69d961bb2a5b5067a511e8ab5875cbe8f3 (diff)
downloadbrew-2ace9422bc4c19be2d6a77e21e66c6dbd4c6bd52.tar.bz2
Better conflict warnings when tapping
Diffstat (limited to 'Library')
-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