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).
This commit is contained in:
Mike McQuaid 2017-02-21 18:31:34 +00:00
parent ed7290abb4
commit 1ea79cd0b3

View File

@ -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