Skip to content
Snippets Groups Projects
Commit e3ed1ccb authored by Xu Cheng's avatar Xu Cheng
Browse files

uninstall: load formula from rack


Closes Homebrew/homebrew#39524.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent bc41f947
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,8 @@ module Homebrew
puts "Uninstalling #{keg}... (#{keg.abv})"
keg.unlink
keg.uninstall
rm_pin keg.name
rack = keg/".."
rack = keg.rack
rm_pin rack
if rack.directory?
versions = rack.subdirs.map(&:basename)
verb = versions.length == 1 ? "is" : "are"
......@@ -36,7 +35,7 @@ module Homebrew
end
end
rm_pin name
rm_pin rack
end
end
rescue MultipleVersionsInstalledError => e
......@@ -44,7 +43,7 @@ module Homebrew
puts "Use `brew remove --force #{e.name}` to remove all versions."
end
def rm_pin name
Formulary.factory(name).unpin rescue nil
def rm_pin rack
Formulary.from_rack(rack).unpin rescue nil
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment