From fbd3d4e48a7a9d55d3d493cd938142bb3c8b661b Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 13 Dec 2023 15:24:37 +0000 Subject: [PATCH] cmd/untap: be more careful about formula tap. `Formula#any_version_installed?` doesn't consider taps so we need to manually check the tabs from the kegs instead. See https://github.com/Homebrew/brew/pull/16330#issuecomment-1854007492 onwards for relevant discussion. --- Library/Homebrew/cmd/untap.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/untap.rb b/Library/Homebrew/cmd/untap.rb index 99af3c2638c39..030bdcce81d91 100644 --- a/Library/Homebrew/cmd/untap.rb +++ b/Library/Homebrew/cmd/untap.rb @@ -40,7 +40,9 @@ def untap next end - formula if formula.any_version_installed? + # Can't use Formula#any_version_installed? because it doesn't consider + # taps correctly. + formula if formula.installed_kegs.any? { |keg| keg.tab.tap == tap } end.compact installed_cask_tokens = T.let(nil, T.nilable(T::Set[String]))