Don't use a regexp to match paths, just compare them for equality
This commit is contained in:
parent
ccd31a2dd2
commit
a699eeb468
@ -30,13 +30,12 @@ module Homebrew extend self
|
|||||||
gitignores = (HOMEBREW_LIBRARY/"Formula/.gitignore").read.split rescue []
|
gitignores = (HOMEBREW_LIBRARY/"Formula/.gitignore").read.split rescue []
|
||||||
|
|
||||||
formulae.each do |formula|
|
formulae.each do |formula|
|
||||||
tapd = (HOMEBREW_LIBRARY/"Taps/#{formula}").dirname
|
file = HOMEBREW_LIBRARY.join("Taps", formula)
|
||||||
bn = formula.basename.to_s
|
link = HOMEBREW_LIBRARY.join("Formula", formula.basename)
|
||||||
pn = HOMEBREW_LIBRARY/"Formula/#{bn}"
|
|
||||||
|
|
||||||
if pn.symlink? and (!pn.exist? or pn.realpath.to_s =~ %r[^#{tapd}])
|
if link.symlink? && (!link.exist? || link.resolved_path == file)
|
||||||
pn.delete
|
link.delete
|
||||||
gitignores.delete(bn)
|
gitignores.delete(file.basename.to_s)
|
||||||
untapped += 1
|
untapped += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user