aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-02-21 18:31:34 +0000
committerMike McQuaid2017-02-21 18:31:34 +0000
commit1ea79cd0b33501ce6ed16961d7c82adb8ceb3cd3 (patch)
treeda2b952754f2b27da103f1b4fdae9bbd8f1eae71
parented7290abb4b5a6820c30cd10b141a7713d932fd6 (diff)
downloadbrew-1ea79cd0b33501ce6ed16961d7c82adb8ceb3cd3.tar.bz2
keg: handle missing alias opt link on uninstall.
Fixes an issue introduced in #1192 where there would be a failure if the alias link didn't exist on removal (which would be the case for anything with an alias installed before #1192 was merged).
-rw-r--r--Library/Homebrew/keg.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index b31997d5a..94e3ff55b 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -239,7 +239,10 @@ class Keg
def remove_opt_record
opt_record.unlink
- aliases.each { |a| (opt_record.parent/a).unlink }
+ aliases.each do |a|
+ next if !opt_record.symlink? && !opt_record.exist?
+ (opt_record.parent/a).delete
+ end
opt_record.parent.rmdir_if_possible
end