aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorXu Cheng2015-05-17 21:22:29 +0800
committerXu Cheng2015-05-27 13:53:42 +0800
commite3ed1ccb15a1169aaad42a4c9e8f59db198f5434 (patch)
tree919d882402d59a08b011576d6d17e7f6ff44951d /Library/Homebrew/cmd
parentbc41f947de1f5d2fcd1be9dd67d91e3e002f7032 (diff)
downloadbrew-e3ed1ccb15a1169aaad42a4c9e8f59db198f5434.tar.bz2
uninstall: load formula from rack
Closes Homebrew/homebrew#39524. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/uninstall.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb
index f6a4cd684..22cafd9dd 100644
--- a/Library/Homebrew/cmd/uninstall.rb
+++ b/Library/Homebrew/cmd/uninstall.rb
@@ -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