From 1857dfcd2ebd6e09e101ae4bc26122a7dbd48c38 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 15 Jan 2021 08:57:02 +0000 Subject: [PATCH] keg: check that alias path exists before checking realpath. Otherwise this can be a broken symlink which will raise an exception: https://github.com/Homebrew/homebrew-core/runs/1704569542?check_suite_focus=true#step:6:47 --- Library/Homebrew/keg.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index c96018e059..71987d588a 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -650,7 +650,7 @@ class Keg def remove_alias_symlink(alias_symlink, alias_match_path) if alias_symlink.symlink? && alias_symlink.exist? - alias_symlink.delete if alias_symlink.realpath == alias_match_path.realpath + alias_symlink.delete if alias_match_path.exist? && alias_symlink.realpath == alias_match_path.realpath elsif alias_symlink.symlink? || alias_symlink.exist? alias_symlink.delete end