Remove opt link in Keg#uninstall
This commit is contained in:
parent
de24d73172
commit
76e86891e4
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user