Remove opt link in Keg#uninstall
This commit is contained in:
parent
de24d73172
commit
76e86891e4
@ -11,7 +11,6 @@ module Homebrew
|
|||||||
puts "Uninstalling #{keg}..."
|
puts "Uninstalling #{keg}..."
|
||||||
keg.unlink
|
keg.unlink
|
||||||
keg.uninstall
|
keg.uninstall
|
||||||
rm_opt_link keg.fname
|
|
||||||
rm_pin keg.fname
|
rm_pin keg.fname
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -29,7 +28,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
rm_opt_link name
|
|
||||||
rm_pin name
|
rm_pin name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -38,11 +36,6 @@ module Homebrew
|
|||||||
puts "Use `brew remove --force #{e.name}` to remove all versions."
|
puts "Use `brew remove --force #{e.name}` to remove all versions."
|
||||||
end
|
end
|
||||||
|
|
||||||
def rm_opt_link name
|
|
||||||
optlink = HOMEBREW_PREFIX.join("opt", name)
|
|
||||||
optlink.unlink if optlink.symlink?
|
|
||||||
end
|
|
||||||
|
|
||||||
def rm_pin name
|
def rm_pin name
|
||||||
Formulary.factory(name).unpin rescue nil
|
Formulary.factory(name).unpin rescue nil
|
||||||
end
|
end
|
||||||
|
|||||||
@ -97,6 +97,12 @@ class Keg < Pathname
|
|||||||
def uninstall
|
def uninstall
|
||||||
rmtree
|
rmtree
|
||||||
parent.rmdir_if_possible
|
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
|
end
|
||||||
|
|
||||||
def unlink
|
def unlink
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user