From 3994d5937dba3e3acee816cba94f3fe208cac210 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 8 Apr 2018 16:02:02 -0700 Subject: [PATCH] keg: don't remove versioned aliases on unlink. Fixes #4030. --- Library/Homebrew/keg.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index cf8d1b177e..7e930cc375 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -243,6 +243,8 @@ class Keg end aliases.each do |a| + # versioned aliases are handled below + next if a =~ /.+@./ alias_symlink = opt/a if alias_symlink.symlink? && alias_symlink.exist? alias_symlink.delete if alias_symlink.realpath == opt_record.realpath @@ -252,7 +254,7 @@ class Keg end Pathname.glob("#{opt_record}@*").each do |a| - a = a.basename + a = a.basename.to_s next if aliases.include?(a) alias_symlink = opt/a