uninstall: load formula from rack
Closes Homebrew/homebrew#39524. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
bc41f947de
commit
e3ed1ccb15
@ -11,9 +11,8 @@ module Homebrew
|
|||||||
puts "Uninstalling #{keg}... (#{keg.abv})"
|
puts "Uninstalling #{keg}... (#{keg.abv})"
|
||||||
keg.unlink
|
keg.unlink
|
||||||
keg.uninstall
|
keg.uninstall
|
||||||
rm_pin keg.name
|
rack = keg.rack
|
||||||
|
rm_pin rack
|
||||||
rack = keg/".."
|
|
||||||
if rack.directory?
|
if rack.directory?
|
||||||
versions = rack.subdirs.map(&:basename)
|
versions = rack.subdirs.map(&:basename)
|
||||||
verb = versions.length == 1 ? "is" : "are"
|
verb = versions.length == 1 ? "is" : "are"
|
||||||
@ -36,7 +35,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
rm_pin name
|
rm_pin rack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue MultipleVersionsInstalledError => e
|
rescue MultipleVersionsInstalledError => e
|
||||||
@ -44,7 +43,7 @@ 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_pin name
|
def rm_pin rack
|
||||||
Formulary.factory(name).unpin rescue nil
|
Formulary.from_rack(rack).unpin rescue nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user