Remove opt link in Keg#uninstall

This commit is contained in:
Jack Nagel 2014-06-23 21:56:57 -05:00
parent de24d73172
commit 76e86891e4
2 changed files with 6 additions and 7 deletions

View File

@ -11,7 +11,6 @@ module Homebrew
puts "Uninstalling #{keg}..."
keg.unlink
keg.uninstall
rm_opt_link keg.fname
rm_pin keg.fname
end
end
@ -29,7 +28,6 @@ module Homebrew
end
end
rm_opt_link name
rm_pin name
end
end
@ -38,11 +36,6 @@ module Homebrew
puts "Use `brew remove --force #{e.name}` to remove all versions."
end
def rm_opt_link name
optlink = HOMEBREW_PREFIX.join("opt", name)
optlink.unlink if optlink.symlink?
end
def rm_pin name
Formulary.factory(name).unpin rescue nil
end

View File

@ -97,6 +97,12 @@ class Keg < Pathname
def uninstall
rmtree
parent.rmdir_if_possible
opt = HOMEBREW_PREFIX.join("opt", fname)
if opt.symlink? && self == opt.resolved_path
opt.unlink
opt.parent.rmdir_if_possible
end
end
def unlink