aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-04-24 20:45:36 -0500
committerJack Nagel2014-04-24 20:45:36 -0500
commita699eeb468956446d9ae7e71df7deaf7d214844b (patch)
tree0f9de7bcdae1dc92268c0e2217eac6115eccfbc3
parentccd31a2dd26ce5db8f247f8261e808702d061454 (diff)
downloadbrew-a699eeb468956446d9ae7e71df7deaf7d214844b.tar.bz2
Don't use a regexp to match paths, just compare them for equality
-rw-r--r--Library/Homebrew/cmd/untap.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb
index 8d58e2a5b..e013b5ca6 100644
--- a/Library/Homebrew/cmd/untap.rb
+++ b/Library/Homebrew/cmd/untap.rb
@@ -30,13 +30,12 @@ module Homebrew extend self
gitignores = (HOMEBREW_LIBRARY/"Formula/.gitignore").read.split rescue []
formulae.each do |formula|
- tapd = (HOMEBREW_LIBRARY/"Taps/#{formula}").dirname
- bn = formula.basename.to_s
- pn = HOMEBREW_LIBRARY/"Formula/#{bn}"
+ file = HOMEBREW_LIBRARY.join("Taps", formula)
+ link = HOMEBREW_LIBRARY.join("Formula", formula.basename)
- if pn.symlink? and (!pn.exist? or pn.realpath.to_s =~ %r[^#{tapd}])
- pn.delete
- gitignores.delete(bn)
+ if link.symlink? && (!link.exist? || link.resolved_path == file)
+ link.delete
+ gitignores.delete(file.basename.to_s)
untapped += 1
end
end